Skip to content

Commit

Permalink
fix: fullscreen and browser conficts
Browse files Browse the repository at this point in the history
  • Loading branch information
chansee97 committed May 14, 2024
1 parent 8bafc3a commit 344baa7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
12 changes: 10 additions & 2 deletions src/layouts/components/header/FullScreen.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
import { useAppStore } from '@/store'
const appStore = useAppStore()
useMagicKeys({
passive: false,
onEventFired(e) {
if (e.key === 'F11' && e.type === 'keydown') {
e.preventDefault()
appStore.toggleFullScreen()
}
},
})
</script>

<template>
Expand All @@ -15,5 +25,3 @@ const appStore = useAppStore()
<span>{{ $t('app.toggleFullScreen') }}</span>
</n-tooltip>
</template>

<style scoped></style>
12 changes: 11 additions & 1 deletion src/views/demo/editor/rich/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,25 @@ onMounted(() => {
text.value = '<p>模拟 Ajax 异步设置内容</p>'
}, 1500)
})
const active = ref(false)
</script>

<template>
<n-card title="富文本编辑器">
<n-space vertical :size="12">
<n-alert title="基于 Quill 封装" type="success" />
<n-switch v-model:value="active">
<template #checked>
禁用
</template>
<template #unchecked>
启用
</template>
</n-switch>
<n-space :size="12">
<div class="h-2xl">
<RichTextEditor v-model="text" />
<RichTextEditor v-model="text" :disabled="active" />
</div>
<div>
<n-h2>v-html 预览</n-h2>
Expand Down

0 comments on commit 344baa7

Please sign in to comment.