How do I turn off the "label is not a valid value for slot. Expected: " warning

大家好,

希望你能帮我解决我的问题,非常感谢

相关问题图片

7 comments
Comment actions Permalink

can't reproduce with similar code. What IDE version is it, do you have a sample project you can share that reproduces the issue?

0
Comment actions Permalink

I didn’t have this warning when I was in a single file, but I got this warning when I created a component in a vue project. My IDE version is 2022.03. I uploaded a new vue project, using vue2+element , below is my code, on my current computer there is this warning.

<template>
<el-descriptions class="margin-top" title="带边框列表" :column="3" :size="size" border>
<template slot="extra">
<el-button type="primary" size="small">操作</el-button>
</template>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-user"></i>
用户名
</template>
kooriookami
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-mobile-phone"></i>
手机号
</template>
18100000000
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-location-outline"></i>
居住地
</template>
苏州市
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-tickets"></i>
备注
</template>
<el-tag size="small">学校</el-tag>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-office-building"></i>
联系地址
</template>
江苏省苏州市吴中区吴中大道 1188 号
</el-descriptions-item>
</el-descriptions>

</template>

<script>
export default {
name: 'demo'
}
</script>

<style scoped>

</style>
0
Comment actions Permalink

thanks, reproduced with your demo. As far as I can see, the IDE can't resolve element-ui components, thus the issue. Seems to be a problem with this particular library version. To improve code completion for different Vue.js component libraries, we have invented a special format of metadata, called web-types, as it's not always possible to resolve components defined in third-party libraries using static code analysis. web-types describe the library's components and their directives and slots.

element-ui@2.15.12 does have "web-types": "./web-types.json" in its package.json, but the file itself is missing in library distribution (https://github.com/ElemeFE/element/issues/22261). So all components and slots are unknown

0
Comment actions Permalink

Thank you very much for your help, now my problem has been solved, I will continue to support your products

0
Comment actions Permalink
Great, thanks for letting me know!
0
Comment actions Permalink

I met this issue either, plz tell me how to turn off the warning. Not just using web-types.

0
Comment actions Permalink

Such issues are specific to libraries/components being used, there are no generic solutions. Please file a new ticket to youtrack, https://youtrack.jetbrains.com/issues/WEB, providing a code sample the issue can be repeated with

0

Please sign in to leave a comment.