保存进度!
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* @Author: Kane
|
||||
* @Date: 2023-01-06 19:05:53
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-01-08 11:18:12
|
||||
* @LastEditTime: 2023-01-08 19:26:26
|
||||
* @FilePath: \admin_system\src\views\news\NewsEdit.vue
|
||||
* @Description:
|
||||
*
|
||||
@@ -11,22 +11,39 @@
|
||||
<template>
|
||||
信息编辑:{{ getCount }}
|
||||
<br>
|
||||
<el-button type="danger" @click="this.add">计数加一</el-button>
|
||||
<SvgIcon icon="house"></SvgIcon>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { useStore } from "vuex";
|
||||
//import { ElMessage } from 'element-plus';
|
||||
|
||||
export default {
|
||||
name: "NewsEdit",
|
||||
data()
|
||||
{
|
||||
return {
|
||||
store: null,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
getCount()
|
||||
{
|
||||
const store = useStore();
|
||||
|
||||
return store.state.app.count;
|
||||
return this.$store.state.app.count;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
add()
|
||||
{
|
||||
let count = this.store.state.app.count + 1;
|
||||
|
||||
this.store.commit("app/SET_COUNT", count);
|
||||
},
|
||||
},
|
||||
created()
|
||||
{
|
||||
this.store = this.$store;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
Reference in New Issue
Block a user