错误描述
Property or method "is not defined on the instance but referenced during render
父组件
<inputDefault :placeholder="请输入内容" :maxlength=5 name="ipt_default"/>
子组件
<template>
<div>
<input v-if="type !== 'textarea'"
:type="type"
class="inner"
:placeholder="placeholder"
:disabled="disabled"
:maxlength="maxlength"
:readonly="readonly"
:name="name"
/>
</div>
</template>
<script type="text/ecmascript-6">
export default{
props : {
type : {
default : "text"
},
placeholder : {
type : String,
default : ""
},
maxlength : {
type : Number
},
disabled : {
type : Boolean,
default : false
},
readonly : {
type : Boolean,
default : false
},
name : {
type : String
},
value : {
type : [String, Number],
default : ""
}
}
};
</script>
结果出错:[Vue warn]: Property or method "请输入内容" is not defined on the instance but referenced during render. Make sure to declare reactive data properties in the data option.
(found in <InputPage> at D:WorkSpace6itoolssrccomponentsinputPageinputPage.vue)
为什么placeholder加冒号出错?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…