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

wpm-wx

v0.0.5

Published

微信小程序集成扩展vue部分功能

Downloads

2

Readme

WPM-WX

wpm 主要是适用于微信小程序的npm包 用于扩展微信小程序的原生this对象。 注:只扩展了Page和Component 想要扩展全局对象,可以直接用this 调用

安装

npm install wpm-wx --save
cnpm install wpm-wx --save

引用

import Wpm from 'wpm-wx'; const Wpm = require("wpm-wx").default;

示例

// 新建main.js
import Wpm from 'wpm-wx';
Wpm.prototype.xxx = xxx;
new Wpm();  // 新建Wpm 对象,最好在App({...}) 运行前执行

<!-- app.js -->
// app.js
import './main.js';
App({});

简介

实现use 和 mixins 方法

Wpm.use(xxx);

Page({
  mixins:[xxx],
})

Component({
  mixins:[xxx],
})

use说明

传入的对象 有一个install函数

{
    install(Wpm) {
      Wpm.prototype.xxx = xxx;
    }
}

mixins说明

使用方式和vue 的相同

版本

  • alpha v0.01

    内置实现mixins 函数, 与VUE的mixins使用方法相似, 例子 Page({mixins:[test]}) mixins 混入方法,实现了所有钩子函数的整合,即page 定义 onshow 混入 的test 文件中也有onshow 执行优先级,则是 先执行test 文件中的onshow 然后再执行page 定义的onshow 局部混入,假设全局混入一个onshow 执行结果是 全局=>局部=>page 普通函数则不支持整合,覆盖优先级,是 page=>局部=>全局

    wp 对象先开放两个方法 use => wp.use(data) 执行data 里的install 方法,install 参数wo对象,在install 方法里面可以全局混入,或者将对象挂载在wp.prototype 上,最后实现挂载在Page和Component实例中 mixins=>wp.mixins(data) data 是个对象,{test(){console.log('test')}}

  • alpha v0.0.2

    1.用ts重写封装逻辑 2.重新设计封装架构,(独立各个模块,以任务中心的形式去设计,所有模块直接只依赖center , 不再依赖具体模块); 3.mixins 的实现优化

  • alpha v0.0.3

    1.修复bug data 对象没有合并成功 2.修复bug 钩子函数未能正确保存调用 3.修复bug 钩子函数的参数未能正确传递,apply 方法使用有误

  • alpha v0.0.4

    1.新增npm关键词

  • alpha v0.0.5

    1.项目关联github