遇到的问题的:评论页面comment.vue引入了一个组件reply.vue,在reply.vue引入了alert弹框组alert.vue,老出现这个错误 el is not defined。
reply.vue代码如下
新手求指教
你只有引用 Alert
,卻沒把他加入父組件的 Components
裡面
import Alert from './nvAlert.vue'
export default {
replace: true,
props: ['topic', 'topicId'],
components: { Alert } // ES6
// components: { 'alert' : Alert } // ES5
}
補充
另外 Vue 的組件名稱大小寫無關,詳情可以看這 资源命名约定
组件命名问题:
<alert :show='alert.show' :txt='alert.txt'></alert>
el绑定一下