uni-app开发
微信小程序开发
使用vue3 vite ts uni-app uni-ui
小知识
-
更改路由页面之后,需要重新运行一下
-
750rpx * 1334rpx 全屏 iPhone6
-
view == div text==span
-
#ifdef H5
#ifdef H5
// 只在 H5 平台下编译的代码块
console.log('This is running on H5 platform.');
#endif
// 这部分代码在所有平台都会编译
console.log('This is common code for all platforms.');
uni-app 命令
- 创建项目
npx degit dcloudio/uni-preset-vue#vite-ts uni-app-vue
- 安装依赖
pnpm i
- 清理依赖
pnpm store prune
- 编译
pnpm dev:mp-weixin
- 运行
Run method: open Weixin Mini Program Devtools, import dist\dev\mp-weixin run.
- 这两个是用来检查ts
pnpm i -D @types/wechat-miniprogram @uni-helper/uni-app-types
- 安装提示
pnpm i -D @uni-helper/uni-ui-types
问题处理
pnpm -i
报错处理
- Error: Expected "0.17.19" but got "0.16.17"
- registry.npmmirror.com+esbuild@0.17.19\node_modules\esbuild
pnpm install esbuild@0.17.19