WebStorm 在我的所有 Vue 組件中標記布爾屬性,并帶有警告“xxx 不是有效值”。我想解決這個問題,但不知道我實際上做錯了什么。
這是重現警告的最小示例:
父組件:
<template>
<child :show="bool1" :disabled="bool2"></child>
</template>
<script>
import Child from './Child.vue';
export default {
name: "Parent",
components: {
Child
},
props: {
bool1: {
type: Boolean,
default: true
}
},
data() {return {
bool2: true
}}
}
</script>
子組件:
<template>
<div></div>
</template>
<script>
export default {
name: "ChildTest",
props: {
show: {
type: Boolean,
default: true
},
disabled: {
type: Boolean,
default: true
}
}
}
</script>
這是 WebStorm 如何標記布爾屬性的螢屏截圖:

我怎樣才能擺脫這些警告?
uj5u.com熱心網友回復:

轉載請註明出處,本文鏈接:https://www.uj5u.com/net/432671.html
上一篇:Vuejs如何提交陣列
