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

ct-adc-textarea

v2.0.0-alpha.1

Published

A Vue.js project

Downloads

17

Readme

ct-adc-textarea

可以自定输入规范的textarea

组件示例图

img

在线demo

在线demo

功能点

  1. 设置textarea的格式和长度限制
  2. 通过slot设置信息的展示

使用

从npm安装ct-adc-textarea

npm install ct-adc-textarea --save

在代码中使用

import Textarea from 'ct-adc-textarea';
Vue.component(Textarea.name,Textarea);

或

new Vue({
    el: ...,
    components: {
        'ct-adc-textarea': Textarea
    }
})

v-model

使用v-model进行值绑定

slots

默认slot

其中scope中的数据如下:

{
    pass: {
        length: Boolean, // 长度是否合法
        format: Boolean // 格式是否合法
    },
    length: Number // 当前内容长度
}
<template slot-scope="scope">
    <span :class="!scope.pass.length ? 'text-danger' : 'text-success'">{{scope.length}}</span>
    <template v-if="limitedLength !== -1">
        /{{limitedLength}}
        <span class="pull-right text-danger" v-if="!scope.pass.length">
        长度不符合要求
    </span>
        <span class="pull-right text-danger" v-else-if="!scope.pass.format">
        格式不符合要求
    </span>
    </template>
</template>

props

参数 | 说明 | 类型 | 默认值 | 可选值 | 描述 | --- | --- | --- | --- | ---- | --- maxLength | 控制的字符长度 | Number | -1(不限) | | cut | 超出长度时是否要截断内容 | Boolean | false | | byByte | 是否根据字节算长度 | Boolean | false | | regexp | 设置不匹配内容的正则 | RegExp | undefined | | 当匹配该正则时,被认为是非法的内容 replaceByEmpty | 不匹配正则时是否禁止输入 | Boolean | false | |

方法

isPass

内容是否是合法的

参数列表

返回值

类型: {Boolean}

说明: 是否合法

事件

事件1

事件名称 | 说明 | 回调参数 | 描述 input | input事件 | textarea的value | change | change事件 | textarea的vulue | blur | blur事件 | 无 | focus | focus事件 | 无 |

更新日志

更新日志

外部资源依赖列表