
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
最實用的 vuex 庫。
The most useful vuex library.
npm i vuex-maps
or
yarn add vuex-maps
use
const store = {
state: {
global: 'global',
},
modules: {
user,
},
}
vuexMaps.use(store)
vuexMaps.use(store, 'private')
vuexMaps.use(store, 'public')
$mounted
async created() {
await vuexMaps.$mounted()
// ...
}
// or
Vue.mixins({
methods: {
watting() {
return vuexMaps.$mounted() // promise
}
}
})
async created() {
await this.watting()
// ...
}
mixins
vuexMaps.mixins('product', ['*'])
vuexMaps.mixins('product', ['state', 'mutations', 'getters', 'actions'])
vuexMaps.mixins('product', {
state: ['*'],
mutations: ['GET_PRODUCTS'],
})
handler
// template
// <input type="text" v-model="productName">
computed: {
productName: vuexMaps.handler('product/name')
}
sync
// template
// <input type="text" v-model="productName">
methods: {
login() {
vuexMaps.sync()
},
callbackLogin() {
// callback
vuexMaps.sync('commit', 'user/logout', {
id: 0,
name: '',
token: '',
})
},
}
state
// @readonly
// user.js (store)
export default {
state: {
name: 'Frank',
},
}
// test.js
vuexMaps.state.user.name // Frank
getters
// @readonly
// user.js (store)
export default {
state: {
firstName: 'Jiahao',
lastName: 'Wu',
},
getters: {
space() {
return ' '
},
funllName(state, getters) {
return state.firstName + getters.space + state.lastName
},
},
}
// test.js
vuexMaps.getters.user.fullName // Jiahao Wu
setState
// user.js (store)
export default {
state: {
name: 'Frank',
},
}
// test.js
vuexMaps.state.user.name // Frank
vuexMaps.setState('user/name', 'Jeff')
vuexMaps.state.user.name // Jeff
}
commit
// user.js (store)
export default {
state: {
name: 'Frank',
},
mutations: {
SET_NAME(state) {
state.name = 'Jeff'
}
}
}
// test.js
vuexMaps.state.user.name // Frank
vuexMaps.commit('user/SET_NAME', 'Jeff')
vuexMaps.state.user.name // Jeff
}
dispatch
// user.js (store)
export default {
state: {
name: 'Frank',
},
actions: {
GET_USERNAME(state, id) {
return new Promise(reslove => {
fetch('/user/' + id).then(res => {
reslove(res.json())
})
})
},
},
}
// test.js
;async () => {
const name = await vuexMaps.dispatch('user/GET_USERNAME', 6)
}
FAQs
最實用的 vuex 庫 (The most useful vuex library.)
We found that vuex-maps demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.