fix(mobile): type direct feedback switch event

This commit is contained in:
2026-07-25 00:16:56 +08:00
parent 09278d40c6
commit f6ffafda30
+5 -1
View File
@@ -55,7 +55,7 @@
:checked="form.anonymous"
color="#c91825"
aria-label="匿名提交"
@change="form.anonymous = Boolean($event.detail.value)"
@change="changeAnonymous"
/>
<view>
<text class="anonymous-title">匿名提交</text>
@@ -167,6 +167,10 @@ const chooseChannel = (channel: DirectChannel) => {
form.anonymous = channel.defaultAnonymous;
};
const changeAnonymous = (event: Event | { detail?: { value?: boolean } }) => {
form.anonymous = Boolean('detail' in event ? event.detail?.value : false);
};
const loadChannels = async () => {
channels.value = await listDirectChannels();
if (!form.channelCode && channels.value.length) chooseChannel(channels.value[0]);