使用v模型将同一对象加载到两个b-form-select中-VueJSbootstrap-vue

问题描述

我需要在几个select内部加载值,该值在我的对象“ objectSelected”内部加载,但是并没有在bootstrap-vue表单内部加载。

不显示任何错误,只是不加载。

list other_type

我的方法“ loadValue”打开使用objectSelected的模态,打开后很好,简单的是不加载v模型中的itens对象。

利用其他对象的其他v模型,完美打开。

我使用bootstrap-vue版本:“ bootstrap-vue”:“ 2.0.0-rc.13”,

解决方法

<b-form-select>具有options属性,您可以将其与options数组绑定,例如:

<template>
...
  <b-form-select
    v-model="selectedItem"
    :options="myOptions"
  />
...
</template>

<script>
...
  data:()=>({
    selectedItem: null,myOptions:[
      {value:"",text:""},// this will set the selectedItem with string
      {value:{},// this with object
    ]
  })
...
</script>