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

@xnsk/fe-utils

v0.0.38

Published

先农数科前端团队工具包

Downloads

7

Readme

公共函数库

标签(空格分隔): utils directive extend filter mixin

安装

npm install @xnsk/fe-utils

引入

全局引入

import feUtil from '@xnsk/fe-utils'
Vue.use(feUtil)

按需引入

//import {utils, directive, extend, filter, mixin} from '@xnsk/fe_utils'
import {utils, directive} from '@xnsk/fe_utils'

utils

  • localTools

  • cookie

  • jsBridge

directive

拖拽

v-drag

<!-- 默认拖拽 -->
<div v-drag></div>

<!-- 参数 -->
<div v-drag="{type:'bothSide',onDrag:fn,callBack:fn2}"></div>
/*
type : 拖拽类型
    空/不传:默认拖拽
    bothSide:就近停靠两侧
onDrag : 拖拽过程回调
callBack: 拖拽完成回调
*/

图片加在失败时显示默认图

v-img-error

<img src='' v-img-error />
/* 全局自定义失败图片地址 */
import { directive } from '@xnsk/fe_utils'
Vue.use(directive,option:{
    //图片异常指令参数
    imgError:{
        errorUrl:'xxxx.png'
    }
})

清除emoji表情和前后空格

v-clear-emoji-trim

只能输入手机号(1开头,11位)

v-only-phone

只能输入正整数

v-only-digit

只能输入正小数

v-only-decimal

 <!-- 默认2位小数 -->
 <input type="text" v-only-decimal placeholder="2位小数"> 
 <!-- 自定义小数位数 -->
 <input type="text" v-only-decimal="1" placeholder="1位小数">
 <!-- 自定义小数点前位数和小数点后位数 -->
 <input type="text" v-only-decimal="[5,1]" placeholder="最多5位整数,1位小数">
 
 

extend

开发中……

filter

开发中……

mixin

开发中……