<template>
????<div>
????????<p>標(biāo)題</p>
????????<input?v-model="title">
????????<p>內(nèi)容</p>
????????<!--<input?v-model="content">-->
????????<button?@click="add()">提交</button>
????</div>
</template>
<script>
????import?store?from?'@/store'
????export?default?{
????????name:?"Add",
????????store,
????????data()?{
????????????return?{
????????????????title:?'1',
????????????????content:?'1',
????????????}
????????},
????????methods:?{
????????????add()?{
????????????????store.commit('add',?{title:?this.title,?content:?this.content})
????????????????this.title?=?''
????????????????this.content?=?''
????????????}
????????}
????}
</script>
<style?scoped>
</style>
2019-02-22
報的錯誤具體是什么??
參考資料:表單輸入綁定