Skip to content

Commit 7cf750f

Browse files
committed
为分辨率选择器添加更新事件处理,移除不必要的观察器
1 parent e4b4e85 commit 7cf750f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/views/VideoPlayer/VideoPlayer.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,11 @@
105105
<!-- 控制栏右侧 -->
106106
<div class="flex items-center ml-auto gap-2">
107107
<!-- 分辨率选择 -->
108-
<NPopselect v-model:value="currentResolution" :options="resolutions">
108+
<NPopselect
109+
v-model:value="currentResolution"
110+
:options="resolutions"
111+
@update:value="changeResolution"
112+
>
109113
<NButton quaternary round class="text-white!">
110114
{{ currentResolutionLabel }}
111115
</NButton>
@@ -619,10 +623,6 @@
619623
muted.value = !muted.value;
620624
};
621625
622-
watch(currentResolution, (val) => {
623-
changeResolution(val);
624-
});
625-
626626
// 切换分辨率
627627
const changeResolution = (value: number) => {
628628
// const resolution = resolutions.value.find((res) => res.label === label);

0 commit comments

Comments
 (0)