Merge remote-tracking branch 'iview/2.0' into 2.0
This commit is contained in:
commit
ce124aeb57
16 changed files with 246 additions and 207 deletions
|
@ -59,8 +59,8 @@
|
|||
handleTriggerItem (item, fromInit = false, fromUser = false) {
|
||||
if (item.disabled) return;
|
||||
|
||||
const cascader = findComponentUpward(this, 'Cascader');
|
||||
if (item.loading !== undefined && !item.children.length) {
|
||||
const cascader = findComponentUpward(this, 'Cascader');
|
||||
if (cascader && cascader.loadData) {
|
||||
cascader.loadData(item, () => {
|
||||
// todo
|
||||
|
@ -110,6 +110,10 @@
|
|||
fromInit: fromInit
|
||||
});
|
||||
}
|
||||
|
||||
if (cascader) {
|
||||
cascader.$refs.drop.update();
|
||||
}
|
||||
},
|
||||
updateResult (item) {
|
||||
this.result = [this.tmpItem].concat(item);
|
||||
|
|
|
@ -30,6 +30,9 @@
|
|||
@keydown="handleKeydown"
|
||||
@focus="handleFocus"
|
||||
@blur="handleBlur"
|
||||
@compositionstart="handleComposition"
|
||||
@compositionupdate="handleComposition"
|
||||
@compositionend="handleComposition"
|
||||
@input="handleInput"
|
||||
@change="handleChange">
|
||||
<div :class="[prefixCls + '-group-append']" v-if="append" v-show="slotReady"><slot name="append"></slot></div>
|
||||
|
@ -62,6 +65,9 @@
|
|||
@keydown="handleKeydown"
|
||||
@focus="handleFocus"
|
||||
@blur="handleBlur"
|
||||
@compositionstart="handleComposition"
|
||||
@compositionupdate="handleComposition"
|
||||
@compositionend="handleComposition"
|
||||
@input="handleInput">
|
||||
</textarea>
|
||||
</div>
|
||||
|
@ -179,7 +185,8 @@
|
|||
slotReady: false,
|
||||
textareaStyles: {},
|
||||
showPrefix: false,
|
||||
showSuffix: false
|
||||
showSuffix: false,
|
||||
isOnComposition: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
@ -244,7 +251,18 @@
|
|||
this.dispatch('FormItem', 'on-form-blur', this.currentValue);
|
||||
}
|
||||
},
|
||||
handleComposition(event) {
|
||||
if (event.type === 'compositionstart') {
|
||||
this.isOnComposition = true;
|
||||
}
|
||||
if (event.type === 'compositionend') {
|
||||
this.isOnComposition = false;
|
||||
this.handleInput(event);
|
||||
}
|
||||
},
|
||||
handleInput (event) {
|
||||
if (this.isOnComposition) return;
|
||||
|
||||
let value = event.target.value;
|
||||
if (this.number && value !== '') value = Number.isNaN(Number(value)) ? value : Number(value);
|
||||
this.$emit('input', value);
|
||||
|
|
|
@ -762,21 +762,12 @@
|
|||
},
|
||||
slotOptions(options, old){
|
||||
// #4626,当 Options 的 label 更新时,v-model 的值未更新
|
||||
if (options && options.length && this.values.length && !this.multiple) {
|
||||
this.values = this.values.map(value => {
|
||||
const option = options.find(option => {
|
||||
if (!option.componentOptions) return false;
|
||||
return option.componentOptions.propsData.value === value.value;
|
||||
});
|
||||
|
||||
if(!option) return null;
|
||||
|
||||
const label = getOptionLabel(option);
|
||||
return {
|
||||
value: value.value,
|
||||
label: label
|
||||
};
|
||||
}).filter(Boolean);
|
||||
// remote 下,调用 getInitialValue 有 bug
|
||||
if (!this.remote) {
|
||||
const values = this.getInitialValue();
|
||||
if (this.flatOptions && this.flatOptions.length && values.length && !this.multiple) {
|
||||
this.values = values.map(this.getOptionData).filter(Boolean);
|
||||
}
|
||||
}
|
||||
|
||||
// 当 dropdown 在控件上部显示时,如果选项列表的长度由外部动态变更了,
|
||||
|
|
|
@ -112,6 +112,10 @@
|
|||
&[disabled] {
|
||||
.disabled();
|
||||
}
|
||||
|
||||
&::placeholder {
|
||||
color: @input-placeholder-color;
|
||||
}
|
||||
}
|
||||
|
||||
&-large {
|
||||
|
|
|
@ -205,9 +205,21 @@
|
|||
height: 24px;
|
||||
line-height: 22px;
|
||||
margin: 3px 4px 3px 0;
|
||||
//i{
|
||||
// top: 2px;
|
||||
//}
|
||||
max-width: 99%;
|
||||
position: relative;
|
||||
span{
|
||||
display: block;
|
||||
margin-right: 14px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
i{
|
||||
display: block;
|
||||
position: absolute;
|
||||
right: 4px;
|
||||
top: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
&-large&-multiple .@{css-prefix}tag{
|
||||
|
@ -215,7 +227,7 @@
|
|||
line-height: 26px;
|
||||
font-size: @font-size-base;
|
||||
i{
|
||||
top: 1px;
|
||||
top: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -225,8 +237,12 @@
|
|||
font-size: @font-size-small;
|
||||
padding: 0 6px;
|
||||
margin: 3px 4px 2px 0;
|
||||
span{
|
||||
margin-right: 14px;
|
||||
}
|
||||
i{
|
||||
top: 1px;
|
||||
right: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,12 +6,21 @@
|
|||
margin: 0;
|
||||
padding: 0;
|
||||
font-size: @font-size-small;
|
||||
&.@{dropdown-prefix-cls}-menu{
|
||||
padding: 0;
|
||||
}
|
||||
li{
|
||||
list-style: none;
|
||||
margin: 8px 0;
|
||||
padding: 0;
|
||||
white-space: nowrap;
|
||||
outline: none;
|
||||
|
||||
&.@{dropdown-item-prefix-cls}{
|
||||
margin: 0;
|
||||
padding: 7px 16px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
li{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue