/wxa

Making wechat mini program development more easy

Primary LanguageJavaScriptMIT LicenseMIT

wxa-core

Build Status NPM version codecov

A tiny library for improving Wechat Mini programs development.:laughing:

use @wxa/cli for better experiment.:smirk:

Detail documents: @wxa/doc💯

更完善的文档:@wxa/doc💯

Feature

  • Mixins
  • Promisify
  • Decorator
  • Router
  • Eventbus
  • Redux

Usage

App

    import {wxa, App} from '@wxa/core';

    @App
    class Main{
        //your logic here
    }
    // start up app
    wxa.launchApp(Main);

Page

    import {wxa, Page} from '@wxa/core';

    @Page
    class Index{
        //your logic here
    }
    // start up app
    wxa.launchPage(Index);

mixins

support mixin object;

    // common.js
    export default {
        data: {
            email: 'genuifx@gmail.com',
        },
        onLoad(q) {
            console.log('common mixin onLoad');
            console.log(q);
            console.log(this.data);
        },
        methods: {
            bindViewTap() {
                this.router.push('../logs/logs');
            },
        },
    };
    // page instance

    @Page
    class Index{
        mixins = [common]
        //your logic here
    }