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
d218755b4c
commit
8f141fd49e
@ -117,7 +117,7 @@ const emit = defineEmits<{
|
||||
|
||||
const { currentSlide } = storeToRefs(useSlidesStore())
|
||||
|
||||
const writingBoardRef = ref<typeof WritingBoard>()
|
||||
const writingBoardRef = ref<InstanceType<typeof WritingBoard>>()
|
||||
const writingBoardColor = ref('#e2534d')
|
||||
const writingBoardModel = ref<WritingBoardModel>('pen')
|
||||
const blackboard = ref(false)
|
||||
@ -164,6 +164,8 @@ watch(currentSlide, () => {
|
||||
// 每次绘制完成后将绘制完的图片更新到数据库
|
||||
const hanldeWritingEnd = () => {
|
||||
const dataURL = writingBoardRef.value!.getImageDataURL()
|
||||
if (!dataURL) return
|
||||
|
||||
db.writingBoardImgs.where('id').equals(currentSlide.value.id).toArray().then(ret => {
|
||||
const currentImg = ret[0]
|
||||
if (currentImg) db.writingBoardImgs.update(currentImg, { dataURL })
|
||||
|
@ -83,7 +83,7 @@ const audioPlayerPosition = computed(() => {
|
||||
}
|
||||
})
|
||||
|
||||
const audioPlayerRef = ref<typeof AudioPlayer>()
|
||||
const audioPlayerRef = ref<InstanceType<typeof AudioPlayer>>()
|
||||
const toggle = () => {
|
||||
if (!audioPlayerRef.value) return
|
||||
audioPlayerRef.value.toggle()
|
||||
|
@ -177,7 +177,7 @@ const checkEmptyText = () => {
|
||||
}
|
||||
}
|
||||
|
||||
const prosemirrorEditorRef = ref<typeof ProsemirrorEditor>()
|
||||
const prosemirrorEditorRef = ref<InstanceType<typeof ProsemirrorEditor>>()
|
||||
const startEdit = () => {
|
||||
editable.value = true
|
||||
nextTick(() => prosemirrorEditorRef.value && prosemirrorEditorRef.value.focus())
|
||||
|
Loading…
x
Reference in New Issue
Block a user