data() {
return{
plan: '',
planlist: []
}
},
<button v-on:click=“addPlan”>添加任务
methods: {
addPlan() {
if(this.plan == null || this.plan == ''){
return
}
this.planlist.push(this.plan)
this.plan = ''
},
deletePlan(index) {
this.planlist.splice(index, 1)
}
}
computed: {
reversedText: function () {
return this.text.split('').reverse().join('')
}
}
mounted: function() {
console.log("helloWorld")
}