pinia添加更新逻辑
This commit is contained in:
@ -9,10 +9,16 @@ function sub() {
|
||||
store.decrement()
|
||||
}
|
||||
|
||||
function initSchema()
|
||||
{
|
||||
store.initSchema({
|
||||
name:"test"
|
||||
function initScheme() {
|
||||
store.initScheme({
|
||||
name: "test"
|
||||
})
|
||||
}
|
||||
|
||||
function updateScheme(value) {
|
||||
store.$patch(state => {
|
||||
state.scheme = { name: 'shoes', quantity: 1 }
|
||||
state.hasChanged = true
|
||||
})
|
||||
}
|
||||
</script>
|
||||
@ -21,8 +27,7 @@ function initSchema()
|
||||
<div>{{ store.count }}</div>
|
||||
<a-button @click=add>add</a-button>
|
||||
<a-button @click=sub>sub</a-button>
|
||||
<div>{{ store.schema }}</div>
|
||||
<a-button @click=initSchema>initSchema</a-button>
|
||||
|
||||
|
||||
<div>{{ store.scheme }}</div>
|
||||
<a-button @click=initScheme>initScheme</a-button>
|
||||
<a-button @click=updateScheme>updateScheme</a-button>
|
||||
</template>
|
||||
Reference in New Issue
Block a user