项目作者: mini-program-utils

项目描述 :
mixin of mini program
高级语言: JavaScript
项目地址: git://github.com/mini-program-utils/mixins.git
创建时间: 2019-09-28T15:20:58Z
项目社区:https://github.com/mini-program-utils/mixins

开源协议:MIT License

下载


miniprgram-mixin

As we know, in the miniprogram, Component has behaviors to reuse the same logics.But if we want to reuse these logics in Page, there is no solution.

miniprogram-mixin works.


install

  1. yarn add miniprogram-mixin

usage

require it in app.js

  1. // app.js
  2. require('miniprogram-mixin');

Now you can use mixin happily.

  1. // mixin/mixinA.js
  2. module.exports = {
  3. data: {},
  4. onLoad() {}
  5. }

tips: You need to read the npm support documentation for the miniprogram


demo

  • in the demo/ directory
  1. yarn install

Then open the project in devtools.

  • You can also open the code snippet link in wechat devtools.

LICENSE

MIT