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

wetype-simple

v0.0.2-alpha-1

Published

![wetype_group](http://ac-29n1vuqk.clouddn.com/ab3025c1e159febe3d98.png)

Downloads

8

Readme

小程序框架 Wetype Simple 文档

wetype_group

介绍

自微信小程序发布以来,作为一名前端开发者,就一直在关注,并尝试做一款自己的小程序。首先尝试的是官方的开发框架,在开发过程中发现官方框架在许多地方使得代码写得很不舒服,包括不仅限于:

  • API未使用Promise封装
  • setData很繁琐

很快在社区里发现了wepy这样的小程序开发框架,一番尝试后决定用它来开发我的第一款小程序。但在开发过程中,仍然觉得wepy不能满足我的要求:

  • 没有代码提示,用惯了TypeScript再去写纯的JS,没有代码提示是很不舒服的事情
  • 定义对class API不太友好

于是我在wepy的启发下,着手开发出wetype这样的小程序框架,全程用TypeScript开发。

先看一段demo

// myPage.ts

import { Page, wx, wt, types } from 'wetype-simple'
import { MyMixin } from './myMixin'

@Page.decor({
    config: {
        navigationBarTitleText: '我的标题'
    },
    mixins: [MyMixin]
})
class MyPage extends Page {

    list: string[] = []
    title: string = ''

    @Page.watch((newVal) => {
        console.log('newVal', newVal)
    })
    myName: string = 'GrePuG'

    /**
    * 相当于手写一个
    * onInput(e) {
    *     this.inputVal = e.detail.value
    * }
    */
    @Page.input('onInput')
    inputVal: string = ''

    onLoad(options: types.OnloadOptions) {
        this.list.push('hello, world')
        this.title = 'hi'
    }

    @Page.on
    onListChanged(list) {
        this.list = list
    }

    tapItem(e: types.wxEvent) {

    }

}
//- myPage.pug

.page
    .list
        .item(:for="(el, i) in list" :data-i="i" @tap="tapItem")
            .id {{i}}
            .title {{el.title}}