我在 vue js 中有一个下拉菜单。
<v-flex> <v-select label="Select Province" v-bind:items="listProvince" outline v-model="province" persistent-hint @change="loadCity()"></v-select>
</v-flex>
在“listProvince”中,我正在获取数据并显示在下拉列表中,但在控制台中我收到此错误无效的 Prop : Prop “items”的类型检查失败。需要数组,得到字符串。
这是 vue.js 代码:
export default {
props: ["updateView","newBooking"],
data() {
return {
selected: [0],
shipper: "",
address: "",
barangay: "",
city: "",
province: "",
phone: "",
listProvince:"",
selectedCity:"",
bookingObject: {},
isNewBk: false,
};
}
}
请帮助我提前致谢
最佳答案
用一个例子来完成答案...... 来自 Vue 站点的示例:
props: {
title: String,
likes: Number,
isPublished: Boolean,
commentIds: Array,
author: Object,
callback: Function,
contactsPromise: Promise // or any other constructor
}
关于javascript - 无效的 prop : type check failed for prop "items". 预期数组,得到字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53444293/