Commit 5cda0dab by 杨明

fixed

1 parent 9a2b545a
...@@ -304,6 +304,9 @@ export default { ...@@ -304,6 +304,9 @@ export default {
return 1 return 1
// return `r${new Date().getTime()}d${Math.ceil(Math.random() * 1000)}` // return `r${new Date().getTime()}d${Math.ceil(Math.random() * 1000)}`
}, },
setFocus() {
this.savedRange.setStartAfter(document.querySelector('.w-textarea_input'))
},
selectHandler() { selectHandler() {
// 监听选定文本的变动 // 监听选定文本的变动
let sel = window.getSelection() let sel = window.getSelection()
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yangming yangming@didihu.com.cn * @Author: yangming yangming@didihu.com.cn
* @Date: 2023-04-20 15:15:08 * @Date: 2023-04-20 15:15:08
* @LastEditors: yangming yangming@didihu.com.cn * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-06-26 15:52:07 * @LastEditTime: 2023-06-29 11:20:35
* @FilePath: \scrm-micro-battles\src\views\battle\index.vue * @FilePath: \scrm-micro-battles\src\views\battle\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD% * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%
im im
...@@ -46,6 +46,8 @@ export default { ...@@ -46,6 +46,8 @@ export default {
data() { data() {
return { return {
textNum: 0, textNum: 0,
maxNum: 20,
limitContent: '',
emotionStatus: false emotionStatus: false
} }
}, },
...@@ -57,10 +59,6 @@ export default { ...@@ -57,10 +59,6 @@ export default {
mapList: { mapList: {
type: Array, type: Array,
default: () => [] default: () => []
},
maxNum:{
type:Number,
default:200
} }
}, },
components: { components: {
...@@ -85,7 +83,9 @@ export default { ...@@ -85,7 +83,9 @@ export default {
this.textNum = text.length this.textNum = text.length
if (this.textNum > this.maxNum) { if (this.textNum > this.maxNum) {
this.textNum = this.maxNum this.textNum = this.maxNum
this.update(val.substring(0, this.maxNum)) this.update(this.limitContent)
} else {
this.limitContent = val
} }
}, },
//展开表情 //展开表情
...@@ -152,11 +152,9 @@ export default { ...@@ -152,11 +152,9 @@ export default {
if (htm.substr(-1, 1) == '>' && navigator.userAgent.indexOf('Firefox') > 0) { if (htm.substr(-1, 1) == '>' && navigator.userAgent.indexOf('Firefox') > 0) {
htm += ' ' htm += ' '
} }
const html = this.getTextValue(htm),
text = html.replace(/\[.+?\]/g, '').replace(/\${.+?}/g, '')
this.textNum = text.length
setTimeout(() => { setTimeout(() => {
document.querySelector('.w-textarea_input').innerHTML = htm document.querySelector('.w-textarea_input').innerHTML = htm
this.$refs.textContent.setFocus()
}, 100) }, 100)
} }
} }
...@@ -176,7 +174,6 @@ export default { ...@@ -176,7 +174,6 @@ export default {
background: #fafbfe; background: #fafbfe;
border-bottom-right-radius: 4px; border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px; border-bottom-left-radius: 4px;
position: relative;
.btn-group { .btn-group {
display: flex; display: flex;
column-gap: 20px; column-gap: 20px;
...@@ -212,11 +209,7 @@ export default { ...@@ -212,11 +209,7 @@ export default {
} }
} }
.text-num { .text-num {
padding-left: 10px; padding-right: 10px;
font-size: 14px;
color: #999999;
position: absolute;
right: -75px;
} }
} }
.date-picker { .date-picker {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!