1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!-- ******************* 多个输入框 ******************* -->
<template>
<view class="u-flex u-flex-wrap">
<u-input class="input-item" v-for="(item,index) in inputOptions" v-model="item.value" @input="val=>{getValue(item)}" type="text" :key="index" :border="true" :placeholder="item.placeholder" />
</view>
</template>
<script>
import objMixin from './objMixin'
export default {
name: 'XhMultiInput',
components: {},
mixins: [objMixin],
props: {},
data() {
return {}
},
computed: {
inputOptions() {
let options = this.item.inputOptions || []
let result = options.map(item => {
return {
...item,
value: ''
}
})
return result
}
},
watch: {},
mounted() {},
methods: {
getValue(item){
let currentValue = {}
currentValue[item.fieldsName] = item.value
// 以key,value的对象形式传递
this.valueChange(currentValue)
}
}
}
</script>
<style scoped>
.input-item{
width: 31%;
margin: 5rpx;
background: #F4F5F7;
}
</style>