Socket
Book a DemoInstallSign in
Socket

kbone-tool

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kbone-tool

some tools for kbone

latest
Source
npmnpm
Version
0.0.8
Version published
Maintainers
1
Created
Source

kbone-tool

介绍

针对一些特殊场景提供的工具库。

安装

npm install --save kbone-tool

使用

vue

useGlobal

废弃,如果需要全局共享 vuex 状态,建议如下操作:

const state = window.$$global.state || {}
window.$$global.state = state

// 退出页面时来一次 state 的深拷贝
const onShow = () => {
    store.replaceState(window.$$global.state)
}
const onHide = () => {
    window.$$global.state = JSON.parse(JSON.stringify(store.state))
}
window.addEventListener('wxshow', onShow)
window.addEventListener('wxhide', onHide)
window.addEventListener('wxunload', onHide)

weui

useForm

因为原生小程序自定义组件的 relations 不支持跨自定义组件,而 form 表单相关组件用到了此特性,所以在此方法中直接在逻辑层实现 form 表单组件的 relations 逻辑。

import * as kbone from 'kbone-tool'

kbone.weui.useForm()

FAQs

Package last updated on 23 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts