Browse Source

添加vuex

test
liwei 3 years ago
parent
commit
06a427753c
2 changed files with 3 additions and 13 deletions
  1. +3
    -1
      src/store/plant/technologyState.js
  2. +0
    -12
      src/views/plant/technology/index.vue

+ 3
- 1
src/store/plant/technologyState.js View File

@ -1,7 +1,9 @@
export default {
namespaced: true,
state: {
count: 1
count: 1,
plantItem:{},
},
mutations: {
increment(state, componentData) {


+ 0
- 12
src/views/plant/technology/index.vue View File

@ -7,21 +7,9 @@
</template>
<script>
import Product from './product';
import {mapState} from 'vuex';
export default {
components:{
Product
},
data() {
return {};
},
computed:{
...mapState('technologyState', [
'count'
])
},
mounted(){
console.log(this.count);
}
};
</script>


Loading…
Cancel
Save