update ColorPicker
This commit is contained in:
parent
b904fd871d
commit
2baba209b7
2 changed files with 7 additions and 3 deletions
|
@ -5,7 +5,8 @@
|
|||
<AutoComplete v-model="formValidate.name" :data="['Li','Liang','Zhang']" placeholder="请输入姓名"></AutoComplete>
|
||||
</Form-item>
|
||||
<Form-item label="邮箱" prop="mail">
|
||||
<Input v-model="formValidate.mail" placeholder="请输入邮箱"></Input>
|
||||
<!--<Input v-model="formValidate.mail" placeholder="请输入邮箱"></Input>-->
|
||||
<ColorPicker v-model="formValidate.mail"></ColorPicker>
|
||||
</Form-item>
|
||||
<Form-item label="城市" prop="city">
|
||||
<Select v-model="formValidate.city" placeholder="请选择所在地">
|
||||
|
@ -72,8 +73,7 @@
|
|||
{ required: true, message: '姓名不能为空', trigger: 'change' }
|
||||
],
|
||||
mail: [
|
||||
{ required: true, message: '邮箱不能为空', trigger: 'blur' },
|
||||
{ type: 'email', message: '邮箱格式不正确', trigger: 'blur' }
|
||||
{ required: true, message: '邮箱不能为空', trigger: 'change' }
|
||||
],
|
||||
city: [
|
||||
{ required: true, message: '请选择城市', trigger: 'change' }
|
||||
|
|
|
@ -66,6 +66,7 @@
|
|||
import Alpha from './alpha.vue';
|
||||
|
||||
import { oneOf } from '../../utils/assist';
|
||||
import Emitter from '../../mixins/emitter';
|
||||
|
||||
const prefixCls = 'ivu-color-picker';
|
||||
const inputPrefixCls = 'ivu-input';
|
||||
|
@ -121,6 +122,7 @@
|
|||
|
||||
export default {
|
||||
name: 'ColorPicker',
|
||||
mixins: [ Emitter ],
|
||||
components: { Drop, Confirm, RecommendColors, Saturation, Hue, Alpha },
|
||||
directives: { clickoutside, TransferDom },
|
||||
props: {
|
||||
|
@ -344,11 +346,13 @@
|
|||
const color = this.formatColor;
|
||||
this.$emit('input', color);
|
||||
this.$emit('on-change', color);
|
||||
this.dispatch('FormItem', 'on-form-change', color);
|
||||
this.handleClose();
|
||||
},
|
||||
handleClear () {
|
||||
this.$emit('input', '');
|
||||
this.$emit('on-change', '');
|
||||
this.dispatch('FormItem', 'on-form-change', '');
|
||||
this.handleClose();
|
||||
},
|
||||
handleSelectColor (color) {
|
||||
|
|
Loading…
Add table
Reference in a new issue