mirror of
https://github.com/pipipi-pikachu/PPTist.git
synced 2025-04-15 02:20:00 +08:00
perf: 搜索/替换体验优化
This commit is contained in:
parent
8d34751196
commit
df8e43bdc1
@ -26,6 +26,7 @@ export default () => {
|
||||
handleElementId,
|
||||
editorAreaFocus,
|
||||
thumbnailsFocus,
|
||||
showSearchPanel,
|
||||
} = storeToRefs(mainStore)
|
||||
const { currentSlide } = storeToRefs(useSlidesStore())
|
||||
const { ctrlKeyState, shiftKeyState, spaceKeyState } = storeToRefs(keyboardStore)
|
||||
@ -153,7 +154,7 @@ export default () => {
|
||||
}
|
||||
if (key === KEYS.F) {
|
||||
e.preventDefault()
|
||||
mainStore.setSearchPanelState(true)
|
||||
mainStore.setSearchPanelState(!showSearchPanel.value)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { useMainStore } from '@/store'
|
||||
import useSearch from '@/hooks/useSearch'
|
||||
import MoveablePanel from '@/components/MoveablePanel.vue'
|
||||
@ -75,6 +75,11 @@ const tabs: TabItem[] = [
|
||||
const close = () => {
|
||||
mainStore.setSearchPanelState(false)
|
||||
}
|
||||
|
||||
const searchInpRef = ref<HTMLInputElement>()
|
||||
onMounted(() => {
|
||||
searchInpRef.value!.focus()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
Loading…
x
Reference in New Issue
Block a user