1.0.26 • Published 2 years ago
bcx-common-component v1.0.26
bcx-common-component
功能
1.$JsBridge
概述: h5 to app 通信机制
demo:
挂载: import { JsBridge } from "@/utils/JsBridge.js";
Vue.prototype.$JsBridge = new JsBridge([]); // 这里的参数 是 回调的 集合, 用于app to h5 调用, 在初始化 会注册到类
调用: this.$JsBridge.postToApp("webviewRrefresh");
2.$Loadding
概述: loadding弹窗
demo:
挂载:window.loaddingImpl = new Loadding(this.loaddingImg);
打开: window.loaddingImpl.handleOpen();
关闭: window.loaddingImpl.handleClose();
3.$Debounce
概述: 防抖
demo: new Debounce().init(() => (
cb()
))
4.$TouchUpRefresh
概述: 移动端下滑更新
demo: <TouchUpRefresh @touchUpCallBack="handleTouchUpCallBack">
<div slot="scrollTarget">
<CardComponent
v-for="(item, index) in searchList"
:card-data="item"
:key="index"
@clickCb="handleToDetail(item)"
/>
</div>
</TouchUpRefresh>
5.$WsClass
概述: ws连接类
demo: let wsImpl = new $WsClass(url, cb)
wsImpl.wsSend(msg) 心跳机制ping内部已经写好
6.$AppBridge
概述: app to h5 通信机制
demo:
挂载: import { AppBridge } from "@/utils/AppBridge";
Vue.prototype.$AppBridge = new AppBridge();
调用(解析器,这里只负责解析 如果是web-view, 这里的触发机制是 titleUpdate的回调):
this.$AppBridge.protocolAnalysis(e.title, "share", (res) => {
});
动态注册方法(h5 to app 调用):register(methodName, methodFun)
7.$DeepClone
概述: 深拷贝,解决序列化 无法 序列 map symbol function 等缺陷
demo:
let result = new DeepClone(obj).result
8.$VirtualList
概述: 虚拟列表
demo:
<VirtualList :name="VirtualListId" :remain="remain" :size="size" :items="items" :unit="unit">
<VirtualItem slot="virtual_item" slot-scope="{ item }" :item="item"/>
</VirtualList>
props: {
remain: 8, //可视个数
size: 0.4, // 每格高度
items, //全量数据
VirtualListId: 'gavin', //盒子标识
unit: 'rem', // 单位
unitVal: 0 // 单位转px 进制
}
8.$DragDirective
概述: 虚拟列表
demo:
new $DragDirective(Vue)
<div class="drag-demo" style="position: relative;">
<div v-drag class="drag-target" style="position: absolute;"></div>
</div>
1.0.26
2 years ago
1.0.25
2 years ago
1.0.24
2 years ago
1.0.23
2 years ago
1.0.22
2 years ago
1.0.21
2 years ago
1.0.20
2 years ago
1.0.19
2 years ago
1.0.18
2 years ago
1.0.17
2 years ago
1.0.16
2 years ago
1.0.15
2 years ago
1.0.14
2 years ago
1.0.13
2 years ago
1.0.12
2 years ago
1.0.11
2 years ago
1.0.10
2 years ago
1.0.9
2 years ago
1.0.8
2 years ago
1.0.7
2 years ago
1.0.6
2 years ago
1.0.5
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago