Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

components export的问题 #829

Closed
gws321 opened this issue Jul 28, 2018 · 2 comments
Closed

components export的问题 #829

gws321 opened this issue Jul 28, 2018 · 2 comments
Labels
wontfix This will not be worked on

Comments

@gws321
Copy link

gws321 commented Jul 28, 2018

[问题简单描述]

当在.vue文件内export导入的文件为js,js 内 export 时提示 template 'xxx' not found
问题复现步骤:

  1. index.vue
    <template>
    <div>
    <a></a>
    <b></b>
    </div>
    </template>
    <script>
    import {b, c} from './a'
    export default {
    components: {b, c}
    }
    </script>

  2. a/index.js
    import b from './b'
    import c from './c'
    export {
    b, c
    }

  3. a/b.vue
    <template>
    <div>b</div>
    </template>
    <script>
    export default {
    ...
    }
    </script>

  4. 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

@F-loat
Copy link
Contributor

F-loat commented Aug 7, 2018

目前 mpvue-loader 不支持这种方式,mpvue/mpvue-loader#23 这个 pr 可以参考下

@mpvue-bot mpvue-bot bot added the wontfix This will not be worked on label Oct 23, 2018
@mpvue-bot
Copy link

mpvue-bot bot commented Oct 23, 2018

issue超过30天无更新或响应,7天后将自动关闭,如果问题状态有更新请及时更新issue

@mpvue-bot mpvue-bot bot closed this as completed Oct 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants