Skip to content

mini-program-utils/mixins

Folders and files

NameName
Last commit message
Last commit date

Latest commit

eef690d · Oct 9, 2019

History

11 Commits
Oct 9, 2019
Oct 9, 2019
Oct 9, 2019
Oct 9, 2019
Sep 28, 2019
Oct 9, 2019
Oct 9, 2019

Repository files navigation

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