Browse Source

input组件增加必输标识

pull/49/head
zq 2 weeks ago
parent
commit
b74f63375e
  1. 4
      src/components/GuipInput.vue
  2. 14
      src/views/elementGroups.vue

4
src/components/GuipInput.vue

@ -1,5 +1,5 @@
<template>
<el-form-item :style="{ height: height, ...styleObject }"
<el-form-item :style="{ height: height, ...styleObject }" :required="required"
:class="[{ 'column': column }, { 'w510': addClass == 'w510' }, { 'w388': addClass == 'w388' }, 'form-item']" :label="label"
:prop="prop" :rules="rules">
<p v-if="desc" class="desc_right">{{ desc }}</p>
@ -36,7 +36,7 @@
<script>
export default {
name: 'GuipInput',
props: ['value', 'styleObject', 'disabled', 'defaultValue', 'placeholder',
props: ['value', 'styleObject', 'disabled', 'defaultValue', 'placeholder','required',
'maxlength', 'minLength', 'clear', 'width', 'height', 'showWordLimit',
'label', 'type', 'prop', 'rules', 'column', 'addClass', 'desc', 'unit'],
data() {

14
src/views/elementGroups.vue

@ -11,7 +11,7 @@
</div>
<div class="ele-item">
<label for="">下拉框</label>
<GuipSelect width="600px" v-model="form.card" label="卡片" prop="card" :options="options"
<GuipSelect width="600px" v-model="form.card" label="卡片" :default-value="form.card" prop="card" :options="options" valueKey="id1" labelKey="id2"
defaultValue="选项1" />
</div>
<div>
@ -263,7 +263,7 @@
<div style="width: 800px;height: 150px;">
<h3>表单上下布局 (宽度 510 388 用的最多 已有这2种宽度类名设置)</h3>
<GuipInput ref="GuipInput" column="column" addClass="w510" label="age" desc="这是是右侧文案"
<GuipInput ref="GuipInput" column="column" addClass="w510" required label="age" desc="这是是右侧文案"
v-model="form.age" prop="age" placeholder="这是自定义默认提示语" />
</div>
@ -640,21 +640,31 @@ export default {
options: [{
value: '选项1',
label1: '黄金hhhhhh',
id1:'1',
id2:'啊11哈哈',
label: '黄金糕'
}, {
value: '选项2',
id1:'12',
id2:'啊22哈哈',
label1: '双皮奶hhhhhhhhh',
label: '双皮奶'
}, {
value: '选项3',
id1:'13',
id2:'啊33哈哈',
label1: '蚵仔煎hhhhhhhhh',
label: '蚵仔煎'
}, {
value: '选项4',
id1:'14',
id2:'啊444哈哈',
label1: '双皮奶hhhhhhhhh',
label: '龙须面'
}, {
value: '选项5',
id1:'155',
id2:'啊55哈哈',
label1: '双皮奶hhhhhhhhh',
label: '北京烤鸭'
}],

Loading…
Cancel
Save