import TodoItem from './components/TodoItem' 昨天寫好了,能行,今天打開編譯器這行代碼報(bào)錯(cuò),頁面上啥都沒了,命令行項(xiàng)目也運(yùn)行不了了
<template>
? <div>
? <div>
? ?<input class="mgs" type="text" v-model="inputValue"/>
? ?<button @click="aaa">提交</button>
? ? ?</div>
? ?<ui>
? ?<todo-item
? ? v-for='(item,index) of list'
? ? :key='index'
? ? :content='item'
? ? :index='index'
? ? @delete='ccc'
? ? ></todo-item>
? ?
? ?</ui>
? ?</div>
</template>
<script>
import TodoItem from './components/TodoItem'
export default {
components:{
'todo-item':TodoItem
},
? ? data(){
? ? return{
? ? inputValue:'',
? ? list:[]
? ? }
? ? },
? ? methods:{
? ? aaa(){
? ? this.list.push(this.inputValue)
? ? this.inputValue=''
? ? },
? ? ccc(index){
? ? this.list.splice(index,1)
? ? }
? ? }
? }
</script>
<style>
</style>
2019-02-06
重新啟動(dòng)一下,就好了
2018-08-13
你先檢查一下TodoItem這個(gè)組建有沒有問題,先查看子組件能否接收到父組件的值
2018-06-27
你這是在本文件引用本文件?這樣是不行的啊。基本上所有的引用其實(shí)你可以直接在main.js里就行
2018-06-11
我也是加上這個(gè)就報(bào)錯(cuò)