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

wepy-plugin-vantweapp

v1.0.2

Published

一个wepy插件 用来自动引入template中使用的组件 类似uniapp的easycom

Downloads

9

Readme

wepy-plugin-vantweapp

  • 一个wepy插件
  • 本插件适用于wepy1.7.x及以下版本
  • 根据wpy文件以及引入的组件中使用的标签自动找到对应json文件进行usingComponents注入
  • 页面wpy代码中再也不需要写如下配置了 实在是麻烦的一批
config = {
  usingComponents: {
    'van-icon': '/components/vant-weapp/icon/index',
    'van-search': '/components/vant-weapp/search/index',
  },
}

特性

  • 自动注入
  • 简易配置

用法

  1. 安装@vant/weapp
  $ npm i @vant/weapp -S --production 
  1. 安装wepy-plugin-vantweapp
  $ npm i wepy-plugin-vantweapp
  1. wepy.config.jsplugins项中添加 vant:{}
  plugins: {
    // ...
    vantweapp: {
      pagePath: 'pages',
      // 可选,默认为 pages。如果页面目录不为pages,或有多个目录, 通过此值设置。
      // 参考配置:
      // pagePath: 'page2'                         page2为页面有目录
      // pagePath:['page1','page2',...]            多页面目录
         
      config: {
        // 可选 是否拷贝 node_module 中@vant/weapp到 src/components目录下 如果不拷贝请手动进行拷贝 如果拷贝的话那么ui 就是@vant/weapp
        copy: false,

        // ui 组件在 components下的文件夹名 由于我修改过几个组件 所以这里不拷贝node_module下的文件 而是用我原来的 我的文件夹名是 vant-weapp
        ui: 'vant-weapp'
        
        // 可选,默认为 'van', 组件名前缀。 如果使用其他组件名前缀, 通过此值设置。 通常不用修改
        prefix: 'van-',
      }
    }
    // ...
  }
  1. 运行项目

插件开发的一些提示

  • 编译器是先根据wpy中config配置生成json的,也就是说index.json是先于index.wxml文件生成的。
  • 代码逻辑中处理wxml时分析需要注入的van组件直接去修改对应json文件即可
  • op_obj.json是op内容的格式 也许对你开发插件也有用

其他

非常感谢 wepy-plugin-vant插件的作者 本插件是在其基础上修改得到的