npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bcx-common-component

v1.0.26

Published

公共组件包

Downloads

3

Readme

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>