我在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”中,我正在获取数据并显示在下拉列表中,但是在控制台中,我收到此错误Invalid prop: type check failed for prop "items". Expected Array, got String.
这是vue js代码:
export default {
props: ["updateView","newBooking"],
data() {
return {
selected: [0],
shipper: "",
address: "",
barangay: "",
city: "",
province: "",
phone: "",
listProvince:"",
selectedCity:"",
bookingObject: {},
isNewBk: false,
};
}
}
请提前帮助我
答案 0 :(得分:1)
使用示例完成答案... Vue网站的示例:
props: {
title: String,
likes: Number,
isPublished: Boolean,
commentIds: Array,
author: Object,
callback: Function,
contactsPromise: Promise // or any other constructor
}
答案 1 :(得分:0)
我得到了答案
在这里,我将'province'声明为字符串,并将'listProvince'声明为数组
谢谢