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

giao-text

v0.1.1

Published

小程序文本输入组件,高度自定义,可拓展性。

Downloads

5

Readme

giao-text

小程序文本输入组件,高度自定义,可拓展性。

代码片段示例

导入代码片段 https://developers.weixin.qq.com/s/Sjal5pm87mfC

github https://github.com/oloshe/giao-text

快速开始

安装

npm i giao-text

添加引用

{
  "usingComponents": {
    "giao-text": "../../component/giao-text/index"
  }
}

基础用法

基础用法

<text-control stringSet="1234567890." placeholder="请输入内容"/>

自定义字符集

自定义字符集

<text-control stringSet="112,233,dds,566,#^@,dsd,<>?>,【】,55" separator="," placeholder="请输入内容"/>

自定义Slot

自定义Slot

<text-control id="custom" stringSet="123456789" columns="3" placeholder="请输入内容">
  <view slot="right" class="btn">确定</view>
</text-control>
<text-control id="custom" stringSet="123456789" columns="3" placeholder="请输入内容">
  <icon slot="left" class="icon" type="search" size="25" />
</text-control>

自定义按钮样式

自定义按钮样式

<text-control stringSet="1234567890" columns="5" btn-class="custom-btn" hover-class="custom-hover" collapse-class="collapse" collapseSlot placeholder="请输入内容">
    <icon slot="collapse" type="download" size="25" />
</text-control>

API

Props

|参数|说明|类型|默认值| |-|-|-|-| |string-set|字符集|String|-| |separator|分隔符,用于分割stringSet|String|''| |columns|列数,每行的最大按钮个数|Number|6| |distinct|是否去重|Boolean|false| |combo|当前字符长度为2时,是否将光标移至中间,如"()" "[]"|Boolean|false| |clearable|是否显示清除按钮|Boolean|false| |type|可设置为任意原生类型, 如 number idcard textarea digit|String|'text'| |password|是否是密码类型|Boolean|false| |maxlength|最大长度,设置为-1为不限|Number|-1| |random|按钮是否随机分配位置(在每次输入框获取焦点时)|Boolean|false| |keep|按钮面板是否保持显示|Boolean|false| |collapse-label|收起按钮显示文本|String|'收起'| |collapse-slot|使用收起按钮slot时需设置此属性|Boolean|false| |scroll|是否为滚动显示(单行)|Boolean|false| |hoverStayTime|按钮点击态持续时间|Number|100| |placeholder|输入框为空时占位符|String|-| |placeholder-style|指定 placeholder 的样式|String|-| |placeholder-class|指定 placeholder 的样式类|String|-| |disabled|是否禁用|Boolean|false|

输入框 API 参考 微信官方文档

Events

|事件|说明|返回参数| |-|-|-| |bind:change|内容改变事件|value = event.detail| |bind:input|输入框输入事件,点击按钮不触发|value = event.detail| |bind:focus|输入框获取焦点事件|-| |bind:blur|输入框失去焦点事件|-| |bind:confirm|点击完成按钮时触发|value = event.detail.value| |bind:keyboardheightchange|键盘高度发生变化的时候触发此事件|-|

注:部分输入法由于输入时不主动触发input事件,所以会导致不好的体验