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

zhak-class-vmodel

v1.0.3

Published

公共组件类

Downloads

10

Readme

包含模块

common 对象 {...,common,...} from zhak-test-vmodel

引用方法

main.js 引用 import common from "zhak-class-vmodel"; Vue.prototype.common = new sss.common(); this.(); 文件内引用 import common from "zhak-class-vmodel"; let c = new sss.common(); c.()

控制个性化输出

consoleStyle(title, msg, status, tip)

  • @param {*} title 输出名称
  • @param {*} msg 输出内容
  • @param {*} status 0:紧急 red ,1:严重 yellow ,2:提示 blue
  • @param tip 开启、关闭 顶部提示

页面销毁提示

oblose(state = false, text = "确定要离开吗?")

  • @param {*} state 注册和销毁
  • @param {*} text 提示文字

文字转音频

audios(message)

  • @param {*} message 可读音频文字

延时承诺

timer = (ms)

  • @param {*} ms 毫秒数

日期格式化

dateFormat(thisDate, fmt)

  • @param {*} thisDate 日期 newDate
  • @param {*} fmt 格式

自定义倒计时格式

timeFormat(timesTart, timeEnd)

  • @param {*} timesTart 起始时间
  • @param {*} timeEnd 结束时间 -根据结束时间减去起始时间得到相对应的文字描述

文件字节转换

bytesToSize(bytes)

  • @param {*} bytes 文件字节转换,字节

批量存储 local Storage

ssSet(data, type = true)

  • @param {*} data 数据 {key:value}
  • @param {*} type 存储在浏览器中的位置 localStorage[true]/sessionStorage[false]

批量获取 local Storage

ssGet(data, type = true)

  • @param {*} data 数据 [key,...]
  • @param {*} type 存储在浏览器中的位置 localStorage[true]/sessionStorage[false]

批量删除 local Storage

ssRem(data, type = true)

  • @param {*} data 数据 [key,...]
  • @param {*} type 存储在浏览器中的位置 localStorage[true]/sessionStorage[false]

数组拆分转二维数组

splitArray(data, len)

  • @param {*} data 数据
  • @param {*} len 拆分规则从第几位开始

对象深层拷贝

deepCopy(obj)

  • @param {*} obj 深层拷贝

element 全屏

launchIntoFullscreen(element)

  • @param {*} element 需要全屏的 dom 元素

关闭全屏

exitFullscreen()