Commit 5cda0dab by 杨明

fixed

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