2 Star 15 Fork 2

自然框架 / vue-data-state

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.en.md 1.30 KB
一键复制 编辑 原始数据 按行查看 历史
% 提交于 2021-04-12 14:26 . 写说明,发布到npm

vue-data-state Lightweight state management

Description

Similar to vuex's lightweight data, state, cache integrated management method.

  • Global state,use it like Vuex.
  • Local state,It is valid within the parent component and its child components, and does not affect the sibling component and superior component.
  • Initialization, the global state can be initialized assignment.

It only contains the state, but does not contain the operation methods 、mutations and action. You can use Vue3 Composition API to operate the state.

Source code

https://gitee.com/naturefw/vue-data-state

<script src='https://gitee.com/naturefw/vue-data-state/widget_preview' async defer></script>
<style> .osc_pro_color {color: #ffffff !important;} .osc_panel_color {background-color: #1e252b !important;} .osc_background_color {background-color: #323d47 !important;} .osc_border_color {border-color: #455059 !important;} .osc_desc_color {color: #d7deea !important;} .osc_link_color * {color: #99a0ae !important;} </style>

Installation

  1. npm i vue-data-state

Instructions

like Vuex.

  1. VuexDataState.createStore Create instance, define global state, local state and initialization function.
  2. main.js to app
  3. template use $state
  4. code use VueDS.useStore()
JavaScript
1
https://gitee.com/naturefw/vue-data-state.git
git@gitee.com:naturefw/vue-data-state.git
naturefw
vue-data-state
vue-data-state
master

搜索帮助