..
This commit is contained in:
@@ -32,10 +32,15 @@ module.exports = {
|
|||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
try {
|
try {
|
||||||
|
debugger
|
||||||
const parser = new DOMParser();
|
const parser = new DOMParser();
|
||||||
const doc = parser.parseFromString(this.content, 'text/html');
|
const doc = parser.parseFromString(this.content, 'text/html');
|
||||||
const link = doc.querySelector('a');
|
const link = doc.querySelector('a');
|
||||||
const href = link.getAttribute('href');
|
const href = link.getAttribute('href');
|
||||||
|
if(!href) {
|
||||||
|
this.pdf = false
|
||||||
|
return
|
||||||
|
}
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.pdfObj = new Pdfh5('#pdf-container', {
|
this.pdfObj = new Pdfh5('#pdf-container', {
|
||||||
pdfurl: href,
|
pdfurl: href,
|
||||||
|
|||||||
Reference in New Issue
Block a user