我工作的一個VueJs文件,並嘗試使用<v-select>
所以我在做什麼是:V-選擇不識別標籤支撐
<v-select :options="divisions" label="text" ></v-select>
和我的部門是對象conatining數組id
和text
,但是當我要去我的網頁上我有<% getOptionLabel(option) %>
,而不是爲我的部門價值
這裏的每一個text
值是console.log(this.divisions)
截圖:
所以這是我的代碼:
<form id="MassUpdateDivisionForm">
<v-select v-bind:label="text" :options="divisions"></v-select>
</form>
<script>
import vSelect from "js/vue-select/vue-select.js"
export default {
props: ['product'],
components: {vSelect},
data() {
return {
divisions: []
}
}
methods: {
getDivisions(){
let self = this
this.$http({
url: 'divisions',
method: 'get'
}).then((response)=>{
self.$set('divisions', response.data)
console.log(self.divisions)
//that's where I got the pic
},(response)=>{
alert('something went wrong')
}
)
}
},
created() {
this.getDivisions()
},
}
</script>
您是否可以用一些示例數據在小提琴中演示問題? – Bert