> ## Content Index
> Fetch the complete content index at: https://alvis.org.cn/llms.txt
> Use this file to discover other available public pages before exploring further.

# 🍊 关于vscode开发uni-app中依赖@uni-helper/uni-app-types的配置
- URL: https://alvis.org.cn/a6fd95c4/
- Published: 2026-12-01T09:34:34.000Z
- Updated: 2026-12-01T09:34:34.000Z
- Description: 类型“{ class: string; }”的参数不能赋给类型"ComponentPublicInstanceConstructor"
- Author: jie.chen
- Tags: 古法编程, 解决方案, tsconfig, uniapp, vscode

> **前言 📝**
> 
> 今天在使用vsCode开发uniapp微信小程序的时候，突然发现我的页面都报错了（报错截图放到下面）。然后我就开始找问题，最后发现是我升级了`Vue-Official`插件。当时通过搜索引擎查出来的方案是将插件改为 **`v2.0.12`** 这个版本，还有一种解决方案是在ts配置文件中添加如下代码：
> 
> ```ts
> "vueCompilerOptions": {
>   "nativeTags": ["block", "component", "template", "slot"]
> }
> 
> ```

![image.png](https://alvis.org.cn/content/images/2026/11/30f72070baa2a288fe1dc5fa.png)

**出现上面的原因是把这些标签当成了vue组件，某些属性并没有出现在Vue组件的Interface上面。**

当我在配置`vueCompilerOptions.nativeTags`的时候，出现了错误*不允许的属性*，然后`.vue`文件还是一如既往的飘红。

![image.png](https://alvis.org.cn/content/images/2026/11/b3a0c20dd3d395f91c1811e0.png)

这个时候我们就需要[官网](https://uni-helper.js.org/uni-app-types?ref=alvis.org.cn)了, `nativeTags`属性不在被支持的原因是**在node\_modules文件夹中的@uni-helper/uni-app-types/volar-plugin文件依赖中已经配置好了nativeTags。**

![image.png](https://alvis.org.cn/content/images/2026/11/941c23ef933fcd19b1af2498.png)

那我们需要怎么配置呢？？再次进入到我们的[传送门](https://uni-helper.js.org/uni-app-types?ref=alvis.org.cn)

![image.png](https://alvis.org.cn/content/images/2026/11/0e515462c8728064dbd9a915.png)

当然也需要注意一下`@uni-helper/uni-app-types`包的版本(在0.5.13版本才开始支持plugin写法)：

![image.png](https://alvis.org.cn/content/images/2026/11/0655e08240f3e3ca700944de.png)