Commit 479c82f1 by 杨明

fixed

1 parent 22ac5209
...@@ -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-19 14:37:26 * @LastEditTime: 2023-06-26 15:52:07
* @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
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
</template> </template>
</div> </div>
</div> </div>
<div class="text-num">{{ textNum }}/{{ maxNum }}</div>
</div> </div>
<div v-show="emotionStatus" class="emotion-panel"> <div v-show="emotionStatus" class="emotion-panel">
<emotion-words class="emotion-panel-box" @emotion="handleEmotion" :height="280"></emotion-words> <emotion-words class="emotion-panel-box" @emotion="handleEmotion" :height="280"></emotion-words>
...@@ -44,7 +45,8 @@ import EmotionWords from './EmotionWords' ...@@ -44,7 +45,8 @@ import EmotionWords from './EmotionWords'
export default { export default {
data() { data() {
return { return {
maxNum: 200, textNum: 0,
maxNum: 20,
emotionStatus: false emotionStatus: false
} }
}, },
...@@ -76,10 +78,11 @@ export default { ...@@ -76,10 +78,11 @@ export default {
}, },
updateText(val) { updateText(val) {
const html = this.getTextValue(val), const html = this.getTextValue(val),
text = html.replace(/\[.+?\]/g, '').replace(/\${.+?}/g, ''), text = html.replace(/\[.+?\]/g, '').replace(/\${.+?}/g, '')
textNum = text.length this.textNum = text.length
if (textNum > this.maxNum) { if (this.textNum > this.maxNum) {
this.update(val.substring(html, 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!