fix(reaction): fix disabled-tooltip hover and post-AC dialog copy
- SubmitCode.vue: AC dialog title still told students to '打星
评分' after the reaction UI moved to emoji buttons. Rewritten to
match the emoji-based interaction, with no star/rating language.
- ProblemReaction.vue: n-tooltip's hover trigger merges its
mouseenter/mouseleave onto the single root element of the trigger
slot. That root was an n-button, and disabled form controls never
dispatch mouse events, so the two disabled-state tooltips ('完成本题后可以评价'
and the max-selection message) never appeared. Wrap each button in
a non-disabled <span> and make that the tooltip root so hover
events fire regardless of the button's disabled state.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
<div v-else ref="container" class="reactions">
|
<div v-else ref="container" class="reactions">
|
||||||
<n-tooltip v-for="item in REACTIONS" :key="item.key" trigger="hover">
|
<n-tooltip v-for="item in REACTIONS" :key="item.key" trigger="hover">
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
|
<span class="reaction-trigger">
|
||||||
<n-button
|
<n-button
|
||||||
size="small"
|
size="small"
|
||||||
:disabled="isDisabled(item.key)"
|
:disabled="isDisabled(item.key)"
|
||||||
@@ -14,6 +15,7 @@
|
|||||||
<span v-if="showLabel" class="label">{{ item.label }}</span>
|
<span v-if="showLabel" class="label">{{ item.label }}</span>
|
||||||
<span v-if="counts" class="count">{{ counts[item.key] }}</span>
|
<span v-if="counts" class="count">{{ counts[item.key] }}</span>
|
||||||
</n-button>
|
</n-button>
|
||||||
|
</span>
|
||||||
</template>
|
</template>
|
||||||
{{ tooltipOf(item.key, item.label) }}
|
{{ tooltipOf(item.key, item.label) }}
|
||||||
</n-tooltip>
|
</n-tooltip>
|
||||||
@@ -106,6 +108,10 @@ onMounted(() => {
|
|||||||
gap: 8px;
|
gap: 8px;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
}
|
}
|
||||||
|
.reaction-trigger {
|
||||||
|
display: inline-flex;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
.label {
|
.label {
|
||||||
margin-left: 4px;
|
margin-left: 4px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -259,7 +259,7 @@ watch(
|
|||||||
<!-- 评价弹窗 -->
|
<!-- 评价弹窗 -->
|
||||||
<n-modal
|
<n-modal
|
||||||
preset="card"
|
preset="card"
|
||||||
title="恭喜你成功提交,请对该题进行评价(一星差评,五星好评)"
|
title="恭喜你成功提交,说说你对这道题的感受吧"
|
||||||
:mask-closable="false"
|
:mask-closable="false"
|
||||||
:style="{ maxWidth: isDesktop && '50vw', maxHeight: '80vh' }"
|
:style="{ maxWidth: isDesktop && '50vw', maxHeight: '80vh' }"
|
||||||
v-model:show="commentPanel"
|
v-model:show="commentPanel"
|
||||||
|
|||||||
Reference in New Issue
Block a user