parent
f36be426d4
commit
b89a982e64
7 changed files with 111 additions and 23 deletions
|
@ -2,7 +2,7 @@
|
|||
<div
|
||||
:class="[prefixCls]"
|
||||
v-clickoutside="handleClose">
|
||||
<div v-el:reference>
|
||||
<div v-el:reference :class="[prefixCls + '-rel']">
|
||||
<slot>
|
||||
<i-input
|
||||
:class="[prefixCls + '-editor']"
|
||||
|
|
|
@ -161,6 +161,17 @@
|
|||
const maxRows = autosize.maxRows;
|
||||
|
||||
this.textareaStyles = calcTextareaHeight(this.$els.textarea, minRows, maxRows);
|
||||
},
|
||||
init () {
|
||||
if (this.type !== 'textarea') {
|
||||
this.prepend = this.$els.prepend.innerHTML !== '';
|
||||
this.append = this.$els.append.innerHTML !== '';
|
||||
} else {
|
||||
this.prepend = false;
|
||||
this.append = false;
|
||||
}
|
||||
this.slotReady = true;
|
||||
this.resizeTextarea();
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
@ -171,16 +182,8 @@
|
|||
this.$dispatch('on-form-change', this.value);
|
||||
}
|
||||
},
|
||||
ready () {
|
||||
if (this.type !== 'textarea') {
|
||||
this.prepend = this.$els.prepend.innerHTML !== '';
|
||||
this.append = this.$els.append.innerHTML !== '';
|
||||
} else {
|
||||
this.prepend = false;
|
||||
this.append = false;
|
||||
}
|
||||
this.slotReady = true;
|
||||
this.resizeTextarea();
|
||||
compiled () {
|
||||
this.$nextTick(() => this.init());
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
popper._popper.style.transformOrigin = `center ${ origin }`;
|
||||
}
|
||||
},
|
||||
ready () {
|
||||
compiled () {
|
||||
this.$on('on-update-popper', this.update);
|
||||
this.$on('on-destroy-popper', this.destroy);
|
||||
},
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
const cell = document.createElement('div');
|
||||
cell.innerHTML = template;
|
||||
const _oldParentChildLen = $parent.$children.length;
|
||||
$parent.$compile(cell);
|
||||
$parent.$compile(cell); // todo 这里无法触发 ready 钩子
|
||||
const _newParentChildLen = $parent.$children.length;
|
||||
|
||||
if (_oldParentChildLen !== _newParentChildLen) { // if render normal html node, do not tag
|
||||
|
|
|
@ -4,8 +4,11 @@
|
|||
@date-picker-cells-width: 196px;
|
||||
|
||||
.@{date-picker-prefix-cls} {
|
||||
position: relative;
|
||||
//position: relative;
|
||||
line-height: normal;
|
||||
&-rel{
|
||||
position: relative;
|
||||
}
|
||||
.@{select-dropdown-prefix-cls} {
|
||||
width: auto;
|
||||
padding: 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue