下拉框
<select ref="newText" style="width:80px;" @change="getTitle(text.userId, $refs.newText.value
)">
<option v-for="(item, index) in sel" :key="index" :value="item.value">{{ item.time }}</option>
</select>
Data
values: 3600000,
sel: [
{
value: '请选择',
time: '请选择'
},
{
value: 3600000,
time: '1小时'
},
{
value: 3600000 * 2,
time: '2小时'
},
{
value: 3600000 * 3,
time: '3小时'
},
{
value: 3600000 * 24,
time: '1天'
},
{
value: 3600000 * 48,
time: '2天'
},
{
value: 3600000 * 72,
time: '3天'
},
{
value: 31536000 * 70000,
time: '永久'
}
],
Js
getTitle (a, values) {
gettitle(a, values).then(res => {
values = this.$refs.newText.value
console.log(this.$refs.newText.value)
})
},
本文来自博客园,作者:zjxgdq,转载请注明原文链接:https://www.cnblogs.com/zjxzhj/p/14493487.html