vue is not defined ?????

来源:3-2 todolist组件拆分

NoError2018

2018-09-18 12:08

Vue.component('todo-item',{
  template:'<li>item</li>'
});

export default {
  data:function(){
    return {
     // title :'<span>?</span>This is my first way',
      items:[],
      newItem:'',
      childWold:'',
      isFinished:'thisIsLiClass',
      ishouse:'thisisLihouse',
      firstName:'',
      lastName:'',
      count:0,
      title:'this is hello world',
      content:'balabalabalaba',
      show:true,
      inputValue:''
    }
  },
  computed:{
    fullName:function(){
      return this.firstName + ' ' + this.lastName
    }
  },
  watch:{
    fullName:function(){
      this.count++;
    }
  },
  methods:{
    handleClick:function(){
      this.title = 'how are you'
    },
    handleToggle:function(){
      this.show = !this.show
    },
    handleSubmit:function(){
      this.items.push(this.inputValue);
      this.inputValue = '';
    }
  }

}


写回答 关注

3回答

  • qq_慕仔259194
    2018-11-22 11:41:53

    vue都没引入

  • NoError2018
    2018-09-21 14:49:41

    写的对呀

  • chinaBai
    2018-09-21 10:37:53

    写错了,你这个,这个是用了手脚架之后写的吧,你仔细看看data压根不是那么写的

vue2.5入门

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

146229 学习 · 657 问题

查看课程

相似问题