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 🙏

© 2026 – Pkg Stats / Ryan Hefner

wxa-spec

v0.1.1

Published

微信小程序相关技术的编程元信息/说明书

Readme

wxa-spec

微信小程序相关技术的编程元信息/说明书

image image image

数据源:https://mp.weixin.qq.com/debug/wxadoc/dev/component/

更新日期:2017-07-28

安装

npm i wxa-spec -D

使用

import WxaSpec from 'wxa-spec';

console.log(WxaSpec.element.wxaIcon);
//输出如下对象
{
    name: 'icon',
    desc: '图标。',
    props: [{
        type: 'String',
        name: 'id',
        desc: '组件的唯一标示',
        compute: [Function: bound]
    },
    {
        type: 'String',
        name: 'class',
        desc: '组件的样式类',
        compute: [Function: bound]
    },
    {
        type: 'String',
        name: 'style',
        desc: '组件的内联样式',
        compute: [Function: bound]
    },
    {
        type: 'Boolean',
        name: 'hidden',
    default:
        false,
        desc: '组件是否显示',
        compute: [Function: bound]
    },
    {
        type: 'Any',
        desc: '自定义属性',
        name: [Function: name],
        compute: [Function: bound]
    },
    {
        name: 'type',
        type: 'String',
        desc: 'icon的类型,有效值:success, success_no_circle, info, warn, waiting, cancel, download, search, clear',
        compute: [Function: bound]
    },
    {
        name: 'size',
        type: 'Number',
    default:
        23,
        desc: 'icon的大小,单位px',
        compute: [Function: bound]
    },
    {
        name: 'color',
        type: 'String',
        desc: 'icon的颜色,同css的color',
        compute: [Function: bound]
    }],
    events: {
        tap: {
            type: 'tap',
            bindable: true,
            catchable: true,
            desc: '手指触摸后马上离开'
        },
        longtap: {
            type: 'longtap',
            bindable: true,
            catchable: true,
            desc: '手指触摸后,超过350ms再离开'
        },
        touchstart: {
            type: 'touchstart',
            bindable: true,
            catchable: true,
            desc: '手指触摸动作开始'
        },
        touchmove: {
            type: 'touchmove',
            bindable: true,
            catchable: true,
            desc: '手指触摸后移动'
        },
        touchcancel: {
            type: 'touchcancel',
            bindable: true,
            catchable: true,
            desc: '手指触摸动作被打断,如来电提醒,弹窗'
        },
        touchend: {
            type: 'touchend',
            bindable: true,
            catchable: true,
            desc: '手指触摸动作结束'
        }
    }
}

//计算一个小程序组件的正确属性值,与小程序计算出的值保持一致
var prop = WxaSpec.element.wxaIcon.props.find(prop=>{
    return prop.name == 'size';
});

//23是icon size属性的默认值
prop.compute(null);//23
prop.compute(undefined);//23
prop.compute({});//23
prop.compute('abc');//23

prop.compute('45');//45
prop.compute(10);//10