Skip to content

Commit

Permalink
refactor(Image): 使用tiptap自己提供的nodeViewProps
Browse files Browse the repository at this point in the history
  • Loading branch information
yikoyu committed Apr 1, 2023
1 parent e21bde5 commit 4f4263b
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 38 deletions.
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,5 @@
"vue-tsc": "1.2.0",
"vuetify": "^3.1.11",
"xss": "^1.0.14"
},
"dependencies": {
"vue-types": "^5.0.2"
}
}
43 changes: 26 additions & 17 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions src/extensions/image/Image.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<script setup lang="ts">
import { nodeViewProps } from '@/utils/node-view-props'
import { NodeViewWrapper } from '@tiptap/vue-3'
import { NodeViewWrapper, nodeViewProps } from '@tiptap/vue-3'
import { computed, onMounted, onUnmounted, ref, unref } from 'vue'
import { bool } from 'vue-types'
import { ImageAttrsOptions } from './types'
import { clamp, isNumber, throttle } from '@/utils/utils'
Expand All @@ -19,7 +17,10 @@ const THROTTLE_WAIT_TIME = 16
const props = defineProps({
...nodeViewProps,
selected: bool().isRequired
selected: {
type: Boolean,
required: true
}
})
const maxSize = ref({
Expand Down
14 changes: 0 additions & 14 deletions src/utils/node-view-props.ts

This file was deleted.

0 comments on commit 4f4263b

Please sign in to comment.