Skip to content

mini-program template based on mpVue. 基于 mpVue 的小程序开发模板。

Notifications You must be signed in to change notification settings

zhaotoday/mpvue

Repository files navigation

命令

# 安装依赖
$ npm install

# 开发时构建
$ npm run dev

# 启动图片服务,请先将 http-server 安装到全局
$ cd cdn && http-server -p 88

# 打包构建
$ npm run build

# 指定平台的开发时构建(微信、百度、头条、支付宝)
$ npm dev:wx
$ npm dev:swan
$ npm dev:tt
$ npm dev:my

# 指定平台的打包构建
$ npm build:wx
$ npm build:swan
$ npm build:tt
$ npm build:my

优化开发体验

引入 mpvue-entry

# 安装
$ npm install --save-dev mpvue-entry@next
// webpack.base.conf.js
const MpvueEntry = require('mpvue-entry')

module.exports = {
  entry: MpvueEntry.getEntry('src/app.json'),
  ...
  plugins: [
    new MpvueEntry(),
    ...
  ]
}
// app.json - 支持 js 格式,兼容微信小程序官方配置规范
{
  "pages": [
    {
      "path": "pages/news/list",
      "config": {
        "navigationBarTitleText": "文章列表",
        "enablePullDownRefresh": true
      }
    }
  ],
  "window": {}
}

使用 Sass

# 安装
$ npm install --save node-sass sass-loader

参考

About

mini-program template based on mpVue. 基于 mpVue 的小程序开发模板。

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published