vue-use-store
0.0.5 • Public • Published
import { useStorageUpdate } from 'vue-use-store'
app.use(useStorageUpdate, {
options:["localStorage", "sessionStorage"]
})
import { useStorageUpdate } from 'vue-use-store'
//监听,target是要监听的storage, key是要监听的storage中的某一项键名
useStorageUpdate({
target: "localStorage",
key: "name"
}, (newValue, oldValue) => {
console.log(newValue, oldValue)
})
import { useResize } from 'vue-use-store'
app.use(useResize)
import { useResize } from 'vue-use-store'
useStorageUpdate(el, target=>{
console.log(target)//当前元素的宽高等信息
})
import { useFullScreen } from 'vue-use-store'
app.use(useFullScreen)
import { useFullScreen } from 'vue-use-store'
//el->要全屏的元素, target会返回出来一个close函数,调用即可退出全屏
const target = useStorageUpdate(el)
//用指令的情况下,再次点击会退出全屏
<div v-full-screen>全屏</div>
Readme
Keywords
nonePackage Sidebar
Install
Weekly Downloads