mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-06 18:36:55 +08:00
feat: 重构弹幕组件和工具以改进结构和性能
- 更新 `useWebFetcher.ts`:将事件监听器从 `onEvent` 更改为 `on`,并修改了断开连接处理逻辑,增加了 30 秒后自动重连的功能。 - 增强 `MessageRender.vue`:为 `paidMessages` 使用 v-model,并将生命周期钩子更新为 `beforeUnmount`。 - 引入新组件 `ClientDanmakuItem.vue`:用于渲染具有卡片和文本样式的弹幕条目。 - 创建 `BaseDanmakuItem.vue`:封装弹幕条目的通用逻辑,包括表情符号解析和显示逻辑。 - 添加 `CardStyleDanmakuItem.vue` 和 `TextStyleDanmakuItem.vue`:用于实现不同显示样式的弹幕消息。 - 开发 `danmakuUtils.ts`:提供用于弹幕条目属性和样式的工具函数。 - 改进弹幕组件的 CSS 样式:确保外观统一和响应式布局。
This commit is contained in:
@@ -152,8 +152,8 @@ export default abstract class BaseDanmakuClient {
|
||||
console.warn(`[${this.type}] 弹幕客户端未被启动, 忽略停止操作`);
|
||||
}
|
||||
// 注意: 清空所有事件监听器
|
||||
this.eventsAsModel = this.createEmptyEventModelListeners();
|
||||
this.eventsRaw = this.createEmptyRawEventlisteners();
|
||||
//this.eventsAsModel = this.createEmptyEventModelListeners();
|
||||
//this.eventsRaw = this.createEmptyRawEventlisteners();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user