Giter Site home page Giter Site logo

wechat-mini-native-template's Introduction

原生微信小程序 项目模板

模板中的状态管理器

  • 强化辅助状态管理器 持久化状态管理
  • 独立封装 processor 处理器, 配合缓存持久化状态管理器,使用简单方便
Page 页面使用
const app = getApp()
当 app.js 中, state 里面的状态, 需要使用持久化存储,
// 登陆状态 -- 示例 传入两个值(String,Any),缓存存储键 String, 默认值(可不传当缓存中没有返回字符串''): Any, 
state: {
    loginState: processor.get('loginState',false)
}
在更新状态 app.store.setState({}) 后, 
调用 app.processor.set(key,value) 进行缓存存储(key类型string,value类型any),
方法1: 指定单个值存储 app.processor.set(key,value)
方法2: 多个值存储 app.processor.set({ key: value, key: value, .... })

模板中的mixin

  • 强化辅助mixin, 使mixin更加简单方便 l类似vue2的mixin

wechat-mini-native-template's People

Contributors

kepengqi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.