Failed to resolve async component
daniel-lij opened this issue · comments
`
{{ item.title }}
`
error
`
Failed to resolve async component: function AsyncHandler() {return {
component: AsyncView,
`
{{ item.title }}
<script> import pdf from 'vue-pdf' export default { name: 'Pdf', components: { pdf, }, data() { return { pdfList: [ { pdfUrl: 'https://dakaname.oss-cn-hangzhou.aliyuncs.com/file/2018-12-29/1546049718768.pdf', title: '你好,2019年', }, { pdfUrl: 'http://file.gp58.com/file/2018-11-14/111405.pdf', title: '中信证券观点', }, { pdfUrl: 'https://dakaname.oss-cn-hangzhou.aliyuncs.com/file/2018-12-28/1546003237411.pdf', title: '12月投资月刊', }, { pdfUrl: 'https://dakaname.oss-cn-hangzhou.aliyuncs.com/file/2018-12-28/1546003282521.pdf', title: '丰岭资本观点', }, ], pdfUrl: '', numPages: 1, activeIndex: 0, } }, mounted: function() { this.pdfTask(this.pdfList[0].pdfUrl) }, methods: { pdfTask(pdfUrl) { var self = this var loadingTask = pdf.createLoadingTask(pdfUrl) loadingTask .then((pdf) => { self.pdfUrl = loadingTask self.numPages = pdf.numPages }) .catch((err) => { console.error(err) }) }, pdfClick(pdfUrl, index) { if (index === this.activeIndex) return this.activeIndex = index this.pdfUrl = null this.pdfTask(pdfUrl) }, }, } </script>`
error ` Failed to resolve async component: function AsyncHandler() {return { component: AsyncView,
- vue-pdf version 4.30
- vue.js version vue2.x
- webpack version 4.46.0
- browser version 101.0.4951.67
- OS version window 10