Posted in Javascript onSeptember 06, 2018
错误信息:
Do not use built-in or reserved HTML elements as component id: header
源码:
<script> import header from "./components/header" import aside from "./components/aside" import footer from "./components/footer" export default { name: 'layout', components: { header: header, aside: aside, footer: footer } } </script>
原因:
vue里面不允许使用 Html已有的标签作为自定义标签
修改方案:
<script> import header from "./components/header" import aside from "./components/aside" import footer from "./components/footer" export default { name: 'layout', components: { 'v-header': header, 'v-aside': aside, 'v-footer': footer } } </script>
修复结果: ok!
以上这篇解决vue 引入子组件报错的问题就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持三水点靠木。
解决vue 引入子组件报错的问题
- Author -
hellow_world_声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@