programing

Quasar Framework q-select가 v-모델의 개체를 ID보다 높게 설정함

bestcode 2022. 7. 13. 23:18
반응형

Quasar Framework q-select가 v-모델의 개체를 ID보다 높게 설정함

선택한 코드에 대해 다음과 같은 코드가 있습니다.

     <q-select label="Select country"
                behavior="menu"
                :lazy-rules="true"
                :rules="[val => !!val || 'Select your country']"
                dense outlined v-model="form.code" :options="countries"
                option-label="name" option-value="code">
      </q-select>

그리고 내 vuejs 코드는

<script>
   export default{
      data:()=>({

        form:{
            code:""
         }
        countries:[
              {name:"Country-1", code:"+101"},
              {name:"Country-2", code:"+201"},
           ]
       })

     }

 <script>

에서 나는 의 값을 한다.form.code코드(예: +101)가 됩니다만, 체크하면, 그 값이 풀 오브젝트인 것을 알 수 있습니다.선택 항목에서 옵션 라벨과 옵션 값을 이미 설정했기 때문에 부족한 것은 무엇입니까?

'어울리다'를 써야 요.emit-value ★★★★★★★★★★★★★★★★★」map-options, 를 참조해 주세요.https://selectar.dev/vue-components/select #select #select #sel

언급URL : https://stackoverflow.com/questions/62802286/quasar-framework-q-select-sets-an-object-in-the-v-model-than-the-id

반응형