vue.js version: vue2
using library:
1. vue-cli
2. bootstrap-vue
<b-col sm="2">
<v-selectmenu
:data="app_list"
language='en'
:multiple='true'
key-field="id"
show-field="name"
v-model="app_value"
title='Select Your App'
ref='test'>
</v-selectmenu>
</b-col>
<script>
import vSelectMenu from 'v-selectmenu'
Vue.use(vSelectMenu);
export default {
name : 'App_test',
props: ['sessionKey'],
components: {
},
data:function () {
let options = qs.parse(location.search, { ignoreQueryPrefix: true })
return {
app_value:'',
app_list:[
{
id:0, name:'test',
}
],
},
methods:{
getDate(){
let url = myUrl;
let api_url = axios.get(url)
api_url.then((response)=>{
for(let i =0; i<response.data.length; i++){
this.app_list.push({id:i+1, name:response.data[i]})
}
})
}
}
}
However, v-selectmenu list can't update variable values.
looks like this.
menu list: test
console.log(app_list):
[ { "id": 0, "name": "test" }, { "id": 1, "name": "HAI" }, { "id": 2, "name": "TEST012" } ]