为了账号安全,请及时绑定邮箱和手机立即绑定

vue添加上双向数据绑定就报错

<template>

  <div>

    <div> 

       <input v-model="inputValue"/>/*这一填上v-model就报错https://img1.sycdn.imooc.com//5b5db06d0001c8f705100561.jpg*/

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


正在回答

1 回答

你的data写成了date,

0 回复 有任何疑惑可以回复我~
#1

生物怪兽 提问者

非常感谢!
2018-08-11 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

vue添加上双向数据绑定就报错

我要回答 关注问题
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号