1234567891011121314151617181920212223242526 |
- import { mapState } from 'vuex';
- import store from '@/store';
- let $uStoreKey = [];
- try {
- $uStoreKey = store.state ? Object.keys(store.state) : [];
- } catch (e) {}
- module.exports = {
- beforeCreate() {
-
-
-
- this.$u.vuex = (name, value) => {
- this.$store.commit('$uStore', {
- name,
- value
- });
- };
- },
- computed: {
-
- ...mapState($uStoreKey)
- }
- };
|