2.0.36 • Published 6 months ago

juejin-state v2.0.36

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

juejin-state

Overview

This component is a dynamic, It is built with Vue 3, Vite, TypeScript,pinia, and TypeScript. Permanent storage

npm install juejin-state

in Vue main.ts:

 

 
import pinia,{status,userStore,accessEnvironmentalState} from 'juejin-state'
 
app.use(pinia);
const state = status();
app.provide("globalState", state.state );
accessEnvironmentalState( state.state);
app.mount("#app");
  • accessEnvironmentalState() 获取环境变量状态
  • userStore:{ token: "", user: {} } 用户信息存储
  • status{ status:{UNI_PLATFORM:"h5",VUE_APP_ENV:"dev"} } 状态管理

in Vue Script:

<template>
  <div class=""> {{ glstate?.variable }} </div>
  <div >
       <button @click="glstate.variable ++"   >
        Primary
      </button>
  </div>

</template>
<script setup lang="ts"> 
import {onMounted,inject} from "vue";
const glstate:any = inject("globalState"); 
onMounted(() => {
  glstate.variable =0 // 
});
</script>
2.0.36

6 months ago

2.0.0

6 months ago

0.0.1

6 months ago

1.1.1

6 months ago

1.1.0

6 months ago

1.0.9

6 months ago

1.0.8

6 months ago

1.0.6

6 months ago

1.0.4

6 months ago

1.0.3

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago