vant 下拉選擇 顯示默認值


html

                  <van-dropdown-item 
                        :title="time_value" 
                        v-model="time" 
                        :options="time_option" 
                        @change="changeTime">
                    </van-dropdown-item>

data數據

                time: '',
                time_value:'按早中晚搜索',
                time_option: [
                    {text: '早上',value: 0},
                    {text: '中午',value: 1},
                    {text: '晚上',value: 2},
                ],

函數

            // 選擇星期幾
            changeTime (value) {
                this.time_value = this.time_option[value].text;
                this.time = value
            },


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM