我有一个这样的vue测试文件test.vue
<template>
<div>
{{a}}
</div>
</template>
<script>
export default {
data : () => {a:1},
template: ...,
}
</script>
我想将其加载到vue实例中。
var vm = new Vue({
el: ...,
components : {
'ti-test': () => import("./components/test.vue")
},
...
});
但出现错误
vue.js:597 [Vue warn]: Failed to resolve async component: () => import("./components/test.vue")
Reason: SyntaxError: Unexpected token <
如何使它正常工作?
谢谢