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

vue-direct

v1.1.0

Published

vue常用指令库

Downloads

1

Readme

vue-direct的常用自定义指令

快速上手

安装

npm i -S vue-direct

完整引入

import vueDirect from 'vue-direct'
import Vue from 'vue';

Vue.use(vueDirect);

按需引入

import { autosize, focus, clipboard, ellipsis } from 'vue-direct';
import Vue from 'vue';

// 这里大家选用自己要用的
Vue.use(autosize);
Vue.use(focus);
Vue.use(clipboard);
Vue.use(ellipsis);

指令使用说明

v-focus

功能: 自动获取焦点

值说明

  • 不写:和写成true的意思一样
  • true: 获取焦点
  • false: 失去焦点
  <input v-focus="focused" />

v-clipboard

功能: 自动把v-clipboard的value值复制到剪切板

值说明:

  • data要复制的数据
  • clipboardSuccessHandler复制成功的回调
  • clipboardErrorHandler复制失败的回调
<button v-clipboard="data"
        v-clipboard:success="clipboardSuccessHandler" // Success event handler
        v-clipboard:error="clipboardErrorHandler"
>
  Copy to clipboard
</button>
{
  methods: {
    clipboardSuccessHandler ({ value, event }) {
      console.log('success', value)
    },

    clipboardErrorHandler ({ value, event }) {
      console.log('error', value)
    }
  }
}

v-ellipsis

功能: 超出部分显示省略符

值说明

  • 没有值和设置了1是等效的,表示单行超出显示省略符
  • 设置大于1的值,表示多行(设置的数目)超出显示省略符
<div v-ellipsis=5>
  这个库太好用了,我一定要用,这个库太好用了,我一定要用,这个库太好用了,我一定要用,这个库太好用了,我一定要用,这个库太好用了,我一定要用,这个库太好用了,我一定要用,这个库太好用了,我一定要用,这个库太好用了,我一定要用,这个库太好用了,我一定要用,这个库太好用了,我一定要用,这个库太好用了,我一定要用,这个库太好用了,我一定要用,这个库太好用了,我一定要用,这个库太好用了,我一定要用,
</div>

v-autosize

功能: textarea高度自适应

值说明: 不用设置值

<textarea v-autosize>我们都是🇨🇳人</textarea>