Skip to content

Latest commit

 

History

History
54 lines (34 loc) · 959 Bytes

README.md

File metadata and controls

54 lines (34 loc) · 959 Bytes

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

yarn add miniprogram-mixin

usage

require it in app.js

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

Now you can use mixin happily.

// mixin/mixinA.js
module.exports = {
  data: {},
  onLoad() {}
}

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


demo

  • in the demo/ directory
yarn install

Then open the project in devtools.

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

LICENSE

MIT