fix: pin button in editor can not show on Linux

This commit is contained in:
Lykin 2023-11-24 00:52:48 +08:00
parent 79c943f85d
commit 71978c325b
1 changed files with 7 additions and 8 deletions

View File

@ -63,7 +63,7 @@ watch(
) )
const loading = ref(false) const loading = ref(false)
const pin = ref(false) const isPin = ref(false)
const viewAs = reactive({ const viewAs = reactive({
field: '', field: '',
value: '', value: '',
@ -130,13 +130,13 @@ const onToggleFullscreen = () => {
} }
const onClose = () => { const onClose = () => {
pin.value = false isPin.value = false
emit('close') emit('close')
} }
const onSave = () => { const onSave = () => {
emit('save', viewAs.field, viewAs.value, viewAs.decode, viewAs.format) emit('save', viewAs.field, viewAs.value, viewAs.decode, viewAs.format)
if (!pin.value) { if (!isPin.value) {
nextTick().then(onClose) nextTick().then(onClose)
} }
} }
@ -178,13 +178,12 @@ const onSave = () => {
<template #header-extra> <template #header-extra>
<n-space :size="5"> <n-space :size="5">
<icon-button <icon-button
:button-style="pin ? pinBtnStyle : btnStyle" :button-style="isPin ? pinBtnStyle : btnStyle"
:icon="Pin"
:size="19" :size="19"
:t-tooltip="pin ? 'interface.unpin_edit' : 'interface.pin_edit'" :t-tooltip="isPin ? 'interface.unpin_edit' : 'interface.pin_edit'"
stroke-width="4" stroke-width="4"
@click="pin = !pin"> @click="isPin = !isPin" />
<Pin :inverse="pin" stroke-width="4" />
</icon-button>
<icon-button <icon-button
:button-style="btnStyle" :button-style="btnStyle"
:icon="props.fullscreen ? OffScreen : FullScreen" :icon="props.fullscreen ? OffScreen : FullScreen"