Commit 479c82f1 by 杨明

fixed

1 parent 22ac5209
......@@ -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-19 14:37:26
* @LastEditTime: 2023-06-26 15:52:07
* @FilePath: \scrm-micro-battles\src\views\battle\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%
im
......@@ -31,6 +31,7 @@
</template>
</div>
</div>
<div class="text-num">{{ textNum }}/{{ maxNum }}</div>
</div>
<div v-show="emotionStatus" class="emotion-panel">
<emotion-words class="emotion-panel-box" @emotion="handleEmotion" :height="280"></emotion-words>
......@@ -44,7 +45,8 @@ import EmotionWords from './EmotionWords'
export default {
data() {
return {
maxNum: 200,
textNum: 0,
maxNum: 20,
emotionStatus: false
}
},
......@@ -76,10 +78,11 @@ export default {
},
updateText(val) {
const html = this.getTextValue(val),
text = html.replace(/\[.+?\]/g, '').replace(/\${.+?}/g, ''),
textNum = text.length
if (textNum > this.maxNum) {
this.update(val.substring(html, this.maxNum))
text = html.replace(/\[.+?\]/g, '').replace(/\${.+?}/g, '')
this.textNum = text.length
if (this.textNum > this.maxNum) {
this.textNum = this.maxNum
this.update(val.substring(0,this.maxNum))
}
},
//展开表情
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!