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,
|
handleElementId,
|
||||||
editorAreaFocus,
|
editorAreaFocus,
|
||||||
thumbnailsFocus,
|
thumbnailsFocus,
|
||||||
|
showSearchPanel,
|
||||||
} = storeToRefs(mainStore)
|
} = storeToRefs(mainStore)
|
||||||
const { currentSlide } = storeToRefs(useSlidesStore())
|
const { currentSlide } = storeToRefs(useSlidesStore())
|
||||||
const { ctrlKeyState, shiftKeyState, spaceKeyState } = storeToRefs(keyboardStore)
|
const { ctrlKeyState, shiftKeyState, spaceKeyState } = storeToRefs(keyboardStore)
|
||||||
@ -153,7 +154,7 @@ export default () => {
|
|||||||
}
|
}
|
||||||
if (key === KEYS.F) {
|
if (key === KEYS.F) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
mainStore.setSearchPanelState(true)
|
mainStore.setSearchPanelState(!showSearchPanel.value)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from 'vue'
|
import { onMounted, ref } from 'vue'
|
||||||
import { useMainStore } from '@/store'
|
import { useMainStore } from '@/store'
|
||||||
import useSearch from '@/hooks/useSearch'
|
import useSearch from '@/hooks/useSearch'
|
||||||
import MoveablePanel from '@/components/MoveablePanel.vue'
|
import MoveablePanel from '@/components/MoveablePanel.vue'
|
||||||
@ -75,6 +75,11 @@ const tabs: TabItem[] = [
|
|||||||
const close = () => {
|
const close = () => {
|
||||||
mainStore.setSearchPanelState(false)
|
mainStore.setSearchPanelState(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const searchInpRef = ref<HTMLInputElement>()
|
||||||
|
onMounted(() => {
|
||||||
|
searchInpRef.value!.focus()
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user