This commit is contained in:
kuaifan 2022-06-19 10:07:19 +08:00
parent 793f6152ff
commit 073b1937f0
3 changed files with 23 additions and 2 deletions

View File

@ -209,6 +209,7 @@ export default {
observer: null,
wrapperWidth: 0,
wrapperHeight: 0,
editorHeight: 0,
recordReady: false,
@ -233,6 +234,7 @@ export default {
entries.some(({target, contentRect}) => {
if (target === this.$el) {
this.wrapperWidth = contentRect.width;
this.wrapperHeight = contentRect.height;
} else if (target === this.$refs.editor) {
this.editorHeight = contentRect.height;
}
@ -443,6 +445,10 @@ export default {
dialogInputCache() {
this.$emit('input', this.getInputCache())
},
wrapperHeight(newVal, oldVal) {
this.$emit('on-height-change', {newVal, oldVal})
}
},
methods: {

View File

@ -122,6 +122,7 @@
@on-record="sendRecord"
@on-record-state="onRecordState"
@on-emoji-visible-change="onEventEmojiVisibleChange"
@on-height-change="onHeightChange"
@on-cancel-reply="onCancelReply"
:placeholder="$L('输入消息...')"/>
</div>
@ -436,7 +437,7 @@ export default {
if (this.msgNew > 0 && this.allMsgs.length > 0) {
return 'newmsg'
}
if (this.scrollTail > 50) {
if (this.scrollTail > 500) {
return 'goto'
}
return null
@ -808,6 +809,16 @@ export default {
}
},
onHeightChange({newVal, oldVal}) {
const diff = newVal - oldVal;
if (diff !== 0) {
const {offset, tail} = this.scrollInfo()
if (tail > 0) {
this.onToOffset(offset + diff)
}
}
},
onActive() {
this.$emit("on-active");
},

View File

@ -823,10 +823,14 @@
display: flex;
align-content: center;
justify-content: center;
color: $primary-text-color;
background-color: #ffffff;
border: 1px solid #eeeeee;
box-shadow: 0 4px 8px 0 rgba($primary-text-color, 0.2);
top: -48px;
width: 40px;
height: 40px;
line-height: 40px;
line-height: 38px;
border-radius: 50%;
.taskfont {