vue-plugin-enum-reactive
v1.0.1
Published
plugin for pull enum config from remote and use in frontend
Downloads
8
Readme
vue-plugin-enum-reactivity
plugin for pull enum config from remote and use in frontend
Installation
Using npm:
npm i --save vue-plugin-enum-reactivity
How to use
Vue2
import { EnumReactivityPlugin } from 'vue-plugin-enum-reactivity'
const enumReactivityIns = new EnumReactivityPlugin({
isProd: true,
request: getEnumConf,
})
Vue.use(EnumReactivityPlugin, {
instance: enumReactivityIns
})
new Vue({
data() {
return {
someEnum: this.$getEnum('someKey')
}
},
})
Vue3
import { EnumReactivityPlugin } from 'vue-plugin-enum-reactivity'
const enumReactivityIns = new EnumReactivityPlugin({
isProd: true,
request: getEnumConf,
})
const enumReactivityIns = new EnumReactivityPlugin({
isProd: true,
request: getEnumConf,
})
const someEnum = enumReactivityIns.getEnum('someKey')
TODO
- [x] 枚举值远程拉取并通知变更,触发视图响应式更新
- [x] 支持Vue3
- [ ] 支持本地缓存枚举值配置