add.vue Failed tto compile.
提示说v-if用错,但是只用了v-model呀
<template>
<div>Add</div>
<div>
<p>Title</p>
<label>
<input type="text" v-model="title">
</label>
<p>Content</p>
<label>
<input type="text" v-model="content">
</label>
<div class="btn" @click="add()">ADD</div>
</div>
</template>
<script>
import store from '@/store'
export default {
name: "Add",
store,
data () {
return {
title: '',
content: ''
}
},
methods: {
add () {
store.commit('addItem', {
title: this.title,
content: this.content,
});
this.title = '';
this.content = '';
this.$router.push('/homest')
}
}
}
</script>
<style scoped>
</style>