mirror of
https://github.com/kuaifan/dootask.git
synced 2026-02-22 16:47:52 +00:00
对话框自动获取焦点
This commit is contained in:
parent
856f554a41
commit
e6aa7de922
2
public/css/app.css
vendored
2
public/css/app.css
vendored
File diff suppressed because one or more lines are too long
2
public/js/app.js
vendored
2
public/js/app.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
public/js/build/626.js
vendored
2
public/js/build/626.js
vendored
File diff suppressed because one or more lines are too long
2
public/js/build/900.js
vendored
2
public/js/build/900.js
vendored
File diff suppressed because one or more lines are too long
2
public/js/build/932.js
vendored
2
public/js/build/932.js
vendored
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
54cbae2c450fdbef
|
||||
70863ffd392b29a7
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div ref="aa" class="chat-input-box" :class="boxClass" v-clickoutside="hidePopover">
|
||||
<div class="chat-input-box" :class="boxClass" v-clickoutside="hidePopover">
|
||||
<div class="chat-input-wrapper" @click.stop="focus">
|
||||
<!-- 输入框 -->
|
||||
<div
|
||||
@ -631,7 +631,10 @@ export default {
|
||||
|
||||
focus() {
|
||||
this.$nextTick(() => {
|
||||
this.quill && this.quill.focus()
|
||||
if (this.quill) {
|
||||
this.quill.setSelection(this.quill.getLength())
|
||||
this.quill.focus()
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
@ -204,6 +204,10 @@ export default {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
desktopAutoFocus: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
@ -370,6 +374,12 @@ export default {
|
||||
cacheTimer && clearTimeout(cacheTimer);
|
||||
setTimeout(this.onToBottom, Math.max(0, 100 - (new Date().getTime() - startTime)));
|
||||
}).catch(_ => {});
|
||||
//
|
||||
if (this.$isDesktop && this.desktopAutoFocus) {
|
||||
this.$nextTick(_ => {
|
||||
this.$refs.input.focus()
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
|
||||
@ -140,7 +140,7 @@
|
||||
<div class="msg-dialog-bg-icon"><Icon type="ios-chatbubbles" /></div>
|
||||
<div class="msg-dialog-bg-text">{{$L('选择一个会话开始聊天')}}</div>
|
||||
</div>
|
||||
<DialogWrapper v-if="dialogId > 0" :dialogId="dialogId" @on-active="scrollIntoActive"/>
|
||||
<DialogWrapper v-if="dialogId > 0" :dialogId="dialogId" @on-active="scrollIntoActive" desktop-auto-focus/>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
|
||||
@ -88,6 +88,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
a {
|
||||
&:before,
|
||||
&:after {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
&.ql-blank {
|
||||
&::before {
|
||||
left: 7px;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user