Description
[问题简单描述]
当在.vue文件内export导入的文件为js,js 内 export 时提示 template 'xxx' not found
问题复现步骤:
-
index.vue
<template>
<div>
<a></a>
<b></b>
</div>
</template>
<script>
import {b, c} from './a'
export default {
components: {b, c}
}
</script>
-
a/index.js
import b from './b'
import c from './c'
export {
b, c
}
-
a/b.vue
<template>
<div>b</div>
</template>
<script>
export default {
...
}
</script>
-
a/c.vue
<template>
<div>c</div>
</template>
<script>
export default {
...
}
</script>
npm run dev
VM11791:2 ./a/index$77e68f06.wxml
(anonymous) @ VM11791:2
VM11791:3 Template "index$7e88f077" not found.
2 | <template name="index$77e68f06">
3 | <view class="_div data-v-c964d3c4 container">
> 4 | <template data="{{...$root[$kk+'0'], $root}}" is="index$7e88f077"></template>
| ^
5 | </view>
6 | </template>
(anonymous) @ VM11791:3