Vue တွင် select နှင့် အလုပ်လုပ်ခြင်း
select နှင့် အလုပ်လုပ်ခြင်းသည်
အလားတူပင် ဖြစ်သည် - tag ပေါ်တွင် v-model attribute ကို တပ်ပြီး
၎င်းကို data object ၏ property တစ်ခုနှင့် ချိတ်ဆက်သည်။
ဤ property ထဲသို့ ရွေးချယ်ထားသော option tag ၏
စာသား ဝင်ရောက်လာမည်။
အောက်ပါ code သည် dropdown list ၏ အလုပ်လုပ်ပုံ နမူနာကို ပြသထားသည်။
data() {
return {
selected: 'value1', // နဂိုအတိုင်း တန်ဖိုး
}
}
<template>
<select v-model="selected">
<option>value1</option>
<option>value2</option>
<option>value3</option>
</select>
<p>{{ selected }}</p>
</template>
select ကို အသုံးပြု၍ သုံးစွဲသူအား မည်သည့်မြို့တွင် နေထိုင်သည်ကို
မေးမြန်းပါ။ ရွေးချယ်ထားသော မြို့ကို အတ္ထုပ္ပတ္တိစာပိုဒ်တွင် ပေါ်လာစေရန် ပြုလုပ်ပါ။