2 回答
TA贡献1875条经验 获得超3个赞
<v-col cols="12">
<v-card>
<v-row>
<v-col>
<h3>Pick your time.</h3>
<select name="option" v-model="form.time">
<option value="Current Time">Current Time</option>
<option v-bind:key="i.id" v-for="i in 11" :value="(i+8) + ':00'"> {{ `${i+8}:00` }}</option>
</select></v-col>
</v-row>
</v-card>
</v-col>
<script>
data(){
return {
form:{
time:null
}
}
},
</script>
TA贡献1757条经验 获得超8个赞
<template>
<div>
<select v-model="selected" @change="changeSelected">
<option value="Current Time">Current Time</option>
<option :key="index" v-for="(i,index) in 11" :value="(i+8 >=10 ? String(i+8) : '0'+(i+8)) +':00' ">{{ (i+8 >=10 ? i+8 : '0'+(i+8) )+':00' }}</option>
</select>
</div>
</template>
<script>
export default {
data(){
return{
selected: 'Current Time'
}
},
methods :{
changeSelected(){
console.log(this.selected)
}
}
}
</script>
添加回答
举报