0.1.3 • Published 5 years ago
taro-plugin-auto-pages v0.1.3
taro-plugin-auto-pages
Taro3 的自动生成
pages配置插件,以后不用每次添加页面都修改app.config.js文件。 插件会自动寻找src/pages下的所有index页面,生成src/.tmp/pages.js文件, 然后将pages.js导入app.config.js中使用。
安装
npm i taro-plugin-auto-pages --dev
// or
yarn add taro-plugin-auto-pages --dev使用
// step1 配置插件
const config = {
plugins: [
['taro-plugin-auto-pages',
{
indexPath: 'pages/demo/index' // 默认 pages/index/index
}
],
]
}
// step2 修改 app.config.js
import pages from './.temp/pages';
export default {
pages,
window: {},
...
}问题
- 新增页面需要重启服务
- ...
更新日志
2021-04-26(v0.1.3) 1. fix: taro 从 3.0.18 升级到 3.2.5 时 platform 参数获取报错
2020-08-25(v0.1.1) 1. fix 编译 h5 时忽略处理
2020-08-25(v0.1.0)
1. 代码重构
2. 添加 indexPath 参数用于配置首页,默认 pages/index/index