import TodoItem from './components/TodoItem' 昨天写好了,能行,今天打开编译器这行代码报错,页面上啥都没了,命令行项目也运行不了了

来源:4-2 使用vue-cli开发TodoList

慕瓜3502318

2018-06-04 18:42

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


写回答 关注

4回答

  • 慕粉3685975
    2019-02-06 10:48:20

    重新启动一下,就好了

  • 喔唷
    2018-08-13 16:19:46

    你先检查一下TodoItem这个组建有没有问题,先查看子组件能否接收到父组件的值

  • jspring
    2018-06-27 12:55:51

    你这是在本文件引用本文件?这样是不行的啊。基本上所有的引用其实你可以直接在main.js里就行

  • 慕尼黑6771481
    2018-06-11 15:19:34

    我也是加上这个就报错

vue2.5入门

快速理解Vue编程理念上手Vue2.0开发。

146221 学习 · 657 问题

查看课程

相似问题