或者 https://nodejs.org/en/download/
未安装npm 提示
以下以安装node安装包为例
按任意键继续
安装完成后
https://github.com/wechat-miniprogram/weui-miniprogram
按以下方式避免npm初始化报错
- message: NPM packages not found. Please confirm npm packages which need to build are belong to `miniprogramRoot` directory. Or you may edit project.config.json's `packNpmManually` and `packNpmRelationList`
- appid: wxfdcdeefd46e93725
- openid: o6zAJs4UHtxoUdwBMYwoYl2bQM9Y
- ideVersion: 1.06.2401020
- osType: win32-x64
- time: 2024-03-07 14:31:03
根目录下初始化
npm init -y
安装npm
npm install
配置project.config.json
文件
- "packNpmManually": true,
- "packNpmRelationList": [
- {
- "packageJsonPath": "./package.json",
- "miniprogramNpmDistDir": "./miniprogram/"
- }
- ],
安装小程序weui npm包
npm install --save weui-miniprogram
重新打开此项目
打开工具菜单=>构建npm
- "useExtendedLib": {
- "weui": true
- },
编辑index目录下 index.js
- const app = getApp()
-
- Page({
- data: {
-
- },
- onLoad: function () {
- console.log('代码片段是一种迷你、可分享的小程序或小游戏项目,可用于分享小程序和小游戏的开发经验、展示组件和 API 的使用、复现开发问题和 Bug 等。可点击以下链接查看代码片段的详细文档:')
- console.log('https://mp.weixin.qq.com/debug/wxadoc/dev/devtools/devtools.html')
- },
- })
编辑index目录下 index.wxml
- <progress percent="20" show-info />
- <progress percent="40" stroke-width="12" />
- <progress percent="60" color="pink" />
- <progress percent="80" active />
- <progress percent="100" active />
编辑index目录下 index.wxml
-
- progress {margin: 10px;}
编译运行即可