我收到警告,例如“道具至少应该定义其类型?require-prop-types”
<script>
export default {
props: ['Age', 'Name'],
created(){
....
},
....
}
</script>
答案 0 :(得分:-1)
为避免警告
解决方案1:
props: {
Age: {
type: Number,
},
Name: {
type: String
},
要禁用警告:
解决方案2:
将此规则添加到.eslintrc.js或.eslintrc。*或.eslintrc.json文件中
.eslintrc.js or .eslintrc.* or .eslintrc.json file
rules: {
//....add your existing rules and below line as well
"vue/require-prop-types":0
}