vue添加上雙向數(shù)據(jù)綁定就報(bào)錯(cuò)
<template>
? <div>
? ? <div>?
? ? ? ?<input v-model="inputValue"/>/*這一填上v-model就報(bào)錯(cuò)*/
? ? ? ?<button @click="handleclick">提交</button>
? ? </div>
? ? <ul>
<todo-item? v-for="(item,index) of list"? :key="index" ></todo-item>
? ? </ul>
? </div>
</template>
<script>
import todoitem from './components/todoitem'
export default {
? ? components:{
? 'todo-item':todoitem
},
? ?date : function() {
? ? return{
? ? ? ? ? inputValue:'',
? ? ? ? ? list:[]
? ? ? ? ? }
? },
? ?methods:{
? ?handleclick(){
? ?this.list.push(this.inputValue)
? ? ? ? ? ? this.inputValue=""
? ?}
? ?}
}
?
</script>
<style>
</style>
2018-07-31
你的data寫成了date,