|
15 | 15 | > |
16 | 16 | <!-- 手机 --> |
17 | 17 | <div v-if="item.type === 'phone'" class="wg-phone" :style="item.style"> |
18 | | - <div class="wg-item" :class="[item.labelPosition==='top'?'flex-column':'align-middle']"> |
19 | | - <div class="wg-title" :style="{width:item.labelWidth}" v-show="item.showLabel">{{item.labelTitle}}</div> |
| 18 | + <div class="wg-item" :class="[item.label.labelPosition==='top'?'flex-column':'align-middle']"> |
| 19 | + <div class="wg-title" :style="{width:item.label.labelWidth}" v-show="item.showLabel">{{item.label.labelTitle}}</div> |
20 | 20 | <div class="flex-auto"> |
21 | 21 | <input class="wg-input" v-model="item.value" :placeholder="item.placeholder"> |
22 | 22 | </div> |
23 | 23 | </div> |
24 | | - <div class="wg-item" :class="[item.labelPosition==='top'?'flex-column':'align-middle']" v-if="item.showCode"> |
25 | | - <div class="wg-title flex-none" v-show="item.showLabel" :style="{width:item.labelWidth}">验证码</div> |
| 24 | + <div class="wg-item" :class="[item.label.labelPosition==='top'?'flex-column':'align-middle']" v-if="item.showCode"> |
| 25 | + <div class="wg-title flex-none" v-show="item.showLabel" :style="{width:item.label.labelWidth}">验证码</div> |
26 | 26 | <div class="flex flex-auto"> |
27 | 27 | <input placeholder="验证码" class="wg-input"> |
28 | 28 | <button class="getVerCode-btn" :style="item.style.btnStyle">获取验证码</button> |
|
31 | 31 | </div> |
32 | 32 |
|
33 | 33 | <!-- 输入框 --> |
34 | | - <div v-if="item.type === 'input'" class="wg-item" :class="[item.labelPosition==='top'?'flex-column':'align-middle']" :style="item.style"> |
35 | | - <div class="wg-title" :style="{width:item.labelWidth}" v-show="item.showLabel">{{item.labelTitle}}</div> |
| 34 | + <div v-if="item.type === 'input'" class="wg-item" :class="[item.label.labelPosition==='top'?'flex-column':'align-middle']" :style="item.style"> |
| 35 | + <div class="wg-title" :style="{width:item.label.labelWidth}" v-show="item.showLabel">{{item.label.labelTitle}}</div> |
36 | 36 | <div class="flex-auto"> |
37 | 37 | <input v-model="item.value" :placeholder="item.placeholder" class="wg-input"> |
38 | 38 | </div> |
|
42 | 42 | <div |
43 | 43 | v-if="item.type === 'checkbox'" |
44 | 44 | class="wg-item flex-wrap wg-checkbox" |
45 | | - :class="[item.labelPosition==='top'?'flex-column':'align-middle']" |
| 45 | + :class="[item.label.labelPosition==='top'?'flex-column':'align-middle']" |
46 | 46 | :style="item.style" |
47 | 47 | > |
48 | | - <div class="wg-title" :style="{width:item.labelWidth}">{{item.labelTitle}}</div> |
| 48 | + <div class="wg-title" :style="{width:item.label.labelWidth}">{{item.label.labelTitle}}</div> |
49 | 49 | <div class="flex-auto"> |
50 | 50 | <label class="label" v-for="(optionsItem, key) in item.options" :key="optionsItem + key"> |
51 | 51 | <input class="wg-checkbox-input" :type="item.isRadio?'radio':'checkbox'" :value="optionsItem" v-model="item.value" style="display:none"> |
|
55 | 55 | </div> |
56 | 56 |
|
57 | 57 | <!-- 下拉选择 --> |
58 | | - <div v-if="item.type === 'select'" class="wg-item" :class="[item.labelPosition==='top'?'flex-column':'align-middle']" :style="item.style"> |
59 | | - <div class="wg-title" :style="{width:item.labelWidth}" v-show="item.showLabel">{{item.labelTitle}}</div> |
| 58 | + <div v-if="item.type === 'select'" class="wg-item" :class="[item.label.labelPosition==='top'?'flex-column':'align-middle']" :style="item.style"> |
| 59 | + <div class="wg-title" :style="{width:item.label.labelWidth}" v-show="item.showLabel">{{item.label.labelTitle}}</div> |
60 | 60 | <div class="flex-auto"> |
61 | 61 | <select v-model="item.value" class="wg-select flex-auto"> |
62 | 62 | <option value disabled selected hidden>{{item.placeholder}}</option> |
63 | | - <option v-for="optionsItem in item.options" :key="optionsItem" :value="optionsItem" :label="item.showLabel?item.label:optionsItem"></option> |
| 63 | + <option |
| 64 | + v-for="(optionsItem,key) in item.options" |
| 65 | + :key="optionsItem + key" |
| 66 | + :value="optionsItem" |
| 67 | + :label="item.showLabel?item.label:optionsItem" |
| 68 | + ></option> |
64 | 69 | </select> |
65 | 70 | </div> |
66 | 71 | </div> |
|
69 | 74 | <div |
70 | 75 | v-if="item.type==='switch'" |
71 | 76 | class="wg-item wg-switch" |
72 | | - :class="[item.labelPosition==='top'?'flex-column':'align-middle']" |
| 77 | + :class="[item.label.labelPosition==='top'?'flex-column':'align-middle']" |
73 | 78 | :style="item.style" |
74 | 79 | > |
75 | | - <div class="wg-title" :style="{width:item.labelWidth}">{{item.labelTitle}}</div> |
| 80 | + <div class="wg-title" :style="{width:item.label.labelWidth}">{{item.label.labelTitle}}</div> |
76 | 81 | <label class="label"> |
77 | 82 | <input type="checkbox" class="wg-switch-input" v-model="item.value" style="display:none"> |
78 | 83 | <span class="wg-switch-core"></span> |
79 | 84 | </label> |
80 | 85 | </div> |
81 | 86 |
|
82 | 87 | <!-- 日期选择 --> |
83 | | - <div v-if="item.type === 'date'" class="wg-item" :class="[item.labelPosition==='top'?'flex-column':'align-middle']" :style="item.style"> |
84 | | - <div class="wg-title" :style="{width:item.labelWidth}">{{item.labelTitle}}</div> |
| 88 | + <div v-if="item.type === 'date'" class="wg-item" :class="[item.label.labelPosition==='top'?'flex-column':'align-middle']" :style="item.style"> |
| 89 | + <div class="wg-title" :style="{width:item.label.labelWidth}">{{item.label.labelTitle}}</div> |
85 | 90 | <div class="flex-auto"> |
86 | 91 | <input type="date" v-model="item.value" class="wg-input flex-auto"> |
87 | 92 | </div> |
|
104 | 109 | </div> |
105 | 110 |
|
106 | 111 | <!-- 横向滑动自动选择 --> |
107 | | - <div class="flex flex-center" v-if="item.type === 'h-picker'" :style="item.style"> |
| 112 | + <div class="wg-item" v-if="item.type === 'h-picker'" :class="[item.label.labelPosition==='top'?'flex-column':'align-middle']" :style="item.style"> |
| 113 | + <div class="wg-title" :style="{width:item.label.labelWidth}">{{item.label.labelTitle}}</div> |
108 | 114 | <div class="wg-horizontal-picker"> |
109 | 115 | <div |
110 | 116 | class="picker-item" |
111 | 117 | v-for="(optionsItem,key) in item.options" |
112 | | - :key="optionsItem" |
| 118 | + :key="optionsItem + key" |
113 | 119 | :style="key===0?{ color: item.pickerColor }:{}" |
114 | 120 | >{{optionsItem}}</div> |
115 | 121 | </div> |
|
0 commit comments