Module: ChannelStore

Pinia Store,用于管理活跃群组频道和相关的频道操作。 该 Store 维护活跃频道状态,根据活跃群组过滤频道列表,并提供频道管理操作。
Source:

Methods

(inner) deleteGroupChannel(channelId) → {Promise.<void>}

根据频道 ID 删除群组频道。 成功从 API 删除后,会从本地 `channelList` 中移除该频道。
Parameters:
Name Type Description
channelId string 要删除的频道 ID。
Source:
Throws:
如果 API 调用失败,会在控制台记录错误。
Type
Error
Returns:
一个 Promise,在频道删除时解决。
Type
Promise.<void>

(inner) setActiveChannel(currentChannel) → {void}

设置给定频道为当前选定的活跃频道。
Parameters:
Name Type Description
currentChannel object 要设置为活跃状态的频道对象。
Source:
Returns:
Type
void

(inner) useChannelStore() → {Object}

Pinia Store,用于管理群组频道。 它提供活跃频道的状态,一个基于活跃群组计算的频道列表,以及删除频道和设置活跃频道的操作。
Properties:
Name Type Description
activeChannel Ref.<(object|null)> 当前活跃的频道对象。默认为 `null`。
channelList ComputedRef.<Array.<object>> 计算属性,返回属于活跃群组的群组频道对话列表。
deleteGroupChannel function 根据频道 ID 删除群组频道的操作。
setActiveChannel function 设置当前活跃频道的操作。
Source:
Returns:
Type
Object