"新增:便签编辑页面预览模式功能并完善删除动画"

This commit is contained in:
yuantao
2025-10-17 13:00:48 +08:00
parent e019d7050b
commit 836a3e1916
3 changed files with 255 additions and 38 deletions

View File

@@ -22,7 +22,7 @@ const props = defineProps({
},
})
const emit = defineEmits(['update:modelValue'])
const emit = defineEmits(['update:modelValue', 'focus', 'blur'])
// 全局常量定义
const DELETE_BUTTON_DELAY = 1000 // 删除按钮延时时间(毫秒),用于防止误触
@@ -1325,6 +1325,8 @@ const showToolbar = () => {
if (isKeyboardVisible.value) {
isToolbarVisible.value = true
}
// 通知父组件编辑器获得焦点
emit('focus')
}
// 处理编辑器失焦
@@ -1333,6 +1335,8 @@ const handleBlur = () => {
// 添加延迟以确保点击工具栏按钮时不会立即隐藏
setTimeout(() => {
handleToolbarFocusOut()
// 通知父组件编辑器失去焦点
emit('blur')
}, 200)
}
@@ -1663,7 +1667,7 @@ defineExpose({
font-size: var(--editor-font-size, 1rem);
line-height: var(--editor-line-height, 1.6);
color: var(--note-content);
min-height: 12.5rem;
min-height: 100vh;
background-color: var(--background-card);
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
position: relative;