[Vue warn]: Invalid prop: type check failed for prop "readonly". Expected Boolean, got String with value "true". [Vue warn]: Invalid prop: type check failed for prop "disabled". Expected Boolean, got String with value "true". ……
剛剛開始學習vue,爲了實現只讀展現因此添加readonly屬性,查詢官方文檔發現默認值爲false,因此最終代碼中爲readonly="true"。vue
<el-col :span="8"> <el-form-item label="客戶名稱" prop="custName" status-icon> <el-input maxlength="100" v-model="custName" readonly="true"></el-input> </el-form-item> </el-col>
測試發現雖然實現只讀展現,可是在瀏覽器控制報錯。瀏覽器
直接使用readonly便可,不須要=「ture」。學習
<el-col :span="8"> <el-form-item label="客戶名稱" prop="custName" status-icon> <el-input maxlength="100" v-model="custName" readonly></el-input> </el-form-item> </el-col>