0.1.0 • Published 12 months ago

matias-vue-storage v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

matias-vue-storage

vuerefreactive 添加了本地持久化的能力。

使用

安装

  • pnpm
$ pnpm add -D matias-vue-storage
  • yarn
$ yarn add -D matias-vue-storage
  • npm
$ npm install -D matias-vue-storage

使用

import { localRef, localReactive } from 'matias-vue-storage'

const router = useRouter()

interface TestType {
    random: number
}

const localKey = 'KEY'
let localObjectValue = localReactive<TestType>(localKey + '_OBJECT')

const changeObjectValue = () => {
    localObjectValue.random = Math.random() * 100
}

let localStringValue = localRef(localKey + '_STRING', Math.random() * 100 + '')

const changeStringValue = () => {
    localStringValue.value = `${Math.random() * 100}`
}

版本

0.1.0

  • localRef支持stringbooleannumber
  • localReactive支持object
0.1.0

12 months ago