赞
踩
安装 类型声明文件
pnpm i -D miniprogram-api-typings @uni-helper/uni-app-types
配置 tsconfig.json
types中加入,添加vueCompilerOptions
- "types": [
- "@dcloudio/types", // uni-app API 类型
- "miniprogram-api-typings", // 原生微信小程序类型
- "@uni-helper/uni-app-types" // uni-app 组件类型
- ]
- },
- // vue 编译器类型,校验标签类型
- "vueCompilerOptions": {
- // 原配置 `experimentalRuntimeMode` 现调整为 `nativeTags`
- "nativeTags": ["block", "component", "template", "slot"], // [!code ++]
- "experimentalRuntimeMode": "runtime-uni-app" // [!code --]
- },
- "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。