
Security News
TypeScript Native Previews: 10x Faster Compiler Now on npm for Public Testing
TypeScript Native Previews offers a 10x faster Go-based compiler, now available on npm for public testing with early editor and language support.
@vueblocks/vue-use-vuex
Advanced tools
Use Vuex With Composition API Easily.
yarn add @vueblocks/vue-use-vuex
useVuex
utilities just similar with Vuex Component Binding Helpers
It export these utilities:
import { useVuex } from '@vueblocks/vue-use-vuex'
export default {
...
setup () {
const { useState } = useVuex()
// 写法1: 传字符串参数 'language' 等同于 `state => state.language`
const localState = useState('global', {
theme: 'theme',
lang: 'lang'
})
// 写法2: 箭头函数可使代码更简练
const localState = useState('global', {
theme: state => state.theme,
lang: state => state.lang
})
// 写法3: 常规函数用于计算,等同于箭头函数
const localState = useState('global', {
customTheme (state) {
return 'custom' + state.theme
}
})
// 写法4: 直接映射节点名称相同的计算属性
const localState = useState('global', [
'theme',
'lang'
])
}
...
}
MIT @xiaoluoboding
FAQs
Use Vuex With Composition API Easily.
The npm package @vueblocks/vue-use-vuex receives a total of 824 weekly downloads. As such, @vueblocks/vue-use-vuex popularity was classified as not popular.
We found that @vueblocks/vue-use-vuex 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
TypeScript Native Previews offers a 10x faster Go-based compiler, now available on npm for public testing with early editor and language support.
Research
Security News
Malicious npm packages targeting React, Vue, Vite, Node.js, and Quill remained undetected for two years while deploying destructive payloads.
Security News
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.