Skip to content

Commit 351a293

Browse files
committed
refactor: get rid of all markRaw
1 parent 49885b3 commit 351a293

File tree

14 files changed

+25
-29
lines changed

14 files changed

+25
-29
lines changed

docs/components/content/DragResizeModalPreview.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ModalsContainer, useModal } from 'vue-final-modal'
33
import DragResizeModal from './DragResizeModal.vue'
44
55
const { open } = useModal({
6-
component: markRaw(DragResizeModal),
6+
component: DragResizeModal,
77
})
88
</script>
99

docs/components/content/FullscreenPreview.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ModalsContainer, useModal } from 'vue-final-modal'
33
import Fullscreen from './Fullscreen.vue'
44
55
const { open } = useModal({
6-
component: markRaw(Fullscreen),
6+
component: Fullscreen,
77
})
88
</script>
99

docs/components/content/LoginFormModalPreview.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ModalsContainer, useModal } from 'vue-final-modal'
33
import LoginFormModal from './LoginFormModal.vue'
44
55
const { open, close } = useModal<InstanceType<typeof LoginFormModal>['$props']>({
6-
component: markRaw(LoginFormModal),
6+
component: LoginFormModal,
77
attrs: {
88
onSubmit(formData) {
99
alert(JSON.stringify(formData, null, 2))

docs/components/content/NestedModalPreview.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ModalsContainer, useModal } from 'vue-final-modal'
33
import ConfirmModal from './ConfirmModal.vue'
44
55
const confirm1 = useModal({
6-
component: markRaw(ConfirmModal),
6+
component: ConfirmModal,
77
attrs: {
88
title: 'The first confirm modal',
99
onConfirm() {
@@ -16,7 +16,7 @@ const confirm1 = useModal({
1616
})
1717
1818
const confirm2 = useModal({
19-
component: markRaw(ConfirmModal),
19+
component: ConfirmModal,
2020
attrs: {
2121
title: 'The second confirm modal',
2222
onConfirm() {

docs/components/content/PlainCssConfirmModalPreview.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ModalsContainer, useModal } from 'vue-final-modal'
33
import PlainCssConfirmModal from './PlainCssConfirmModal.vue'
44
55
const { open, close } = useModal({
6-
component: markRaw(PlainCssConfirmModal),
6+
component: PlainCssConfirmModal,
77
attrs: {
88
title: 'Hello World!',
99
onConfirm() {

docs/components/content/UseModalPreview.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import ConfirmModal from './ConfirmModal.vue'
55
const { open, close } = useModal<
66
InstanceType<typeof ConfirmModal>['$props']
77
>({
8-
component: markRaw(ConfirmModal),
8+
component: ConfirmModal,
99
attrs: {
1010
title: 'Hello World!',
1111
onConfirm() {

docs/content/2.get-started/1.guide/3.migration-guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ So this:
8181

8282
```ts
8383
this.$vfm.show({
84-
component: markRaw(ConfirmModal),
84+
component: ConfirmModal,
8585
bind: {
8686
name: 'ConfirmModalName'
8787
},
@@ -103,7 +103,7 @@ Will be re-written as this:
103103

104104
```ts
105105
const { open, close } = useModal<InstanceType<typeof ConfirmModal>['$props']>({
106-
component: markRaw(ConfirmModal),
106+
component: ConfirmModal,
107107
attrs: {
108108
title: 'Hello World!',
109109
onConfirm() {

docs/content/3.api/2.composables/1.use-modal.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,12 @@ import { ModalsContainer } from 'vue-final-modal'
2424
## Usage
2525

2626
```ts
27-
import { markRaw } from 'vue'
2827
import { VueFinalModal, useModal } from 'vue-final-modal'
2928

3029
const modalInstance = useModal<
3130
InstanceType<typeof VueFinalModal>['$props']
3231
>({
33-
component: markRaw(VueFinalModal),
32+
component: VueFinalModal,
3433
attrs: {
3534
// Props
3635
displayDirective: 'if',
@@ -90,14 +89,13 @@ You have to manually calling `modalInstance.destroy()`{lang=ts} whenever you no
9089
- Then you can using `useModal()`{lang=ts} everywhere by given the same `vfm` instance to `options.context`{lang=ts}:
9190
```ts
9291
// Anywhere outside out script setup
93-
import { markRaw } from 'vue'
9492
import { VueFinalModal, useModal } from 'vue-final-modal'
9593
import { vfm } from '@/plugins/vue-final-modal'
9694

9795
export function openConfirmModal() {
9896
const modalInstance = useModal({
9997
context: vfm,
100-
component: markRaw(MyConfirmModal),
98+
component: MyConfirmModal,
10199
attrs: {
102100
onClosed() {
103101
modalInstance.destroy()
@@ -126,14 +124,13 @@ You have to manually calling `modalInstance.destroy()`{lang=ts} whenever you no
126124
- Then you can using `useModal()`{lang=ts} everywhere by given the same `vfm` instance to `options.context`{lang=ts}:
127125
```ts
128126
// Anywhere outside out script setup
129-
import { markRaw } from 'vue'
130127
import { VueFinalModal, useModal } from 'vue-final-modal'
131128
import { vfm } from '@/plugins/vue-final-modal'
132129

133130
export function openConfirmModal() {
134131
const modalInstance = useModal({
135132
context: vfm,
136-
component: markRaw(MyConfirmModal),
133+
component: MyConfirmModal,
137134
attrs: {
138135
onClosed() {
139136
modalInstance.destroy()

examples/nuxt3/components/MyModalPreview.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useModal } from 'vue-final-modal'
33
import MyModal from './MyModal.vue'
44
55
const { open } = useModal<InstanceType<typeof MyModal>['$props']>({
6-
component: markRaw(MyModal),
6+
component: MyModal,
77
attrs: {
88
title: 'Hello World!',
99
},

examples/vue3/src/components/MyModalPreview.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
<script setup lang="ts">
2-
import { markRaw } from 'vue'
32
import { useModal } from 'vue-final-modal'
43
import MyModal from './MyModal.vue'
54
import VButton from './VButton.vue'
65
76
const { open } = useModal<InstanceType<typeof MyModal>['$props']>({
8-
component: markRaw(MyModal),
7+
component: MyModal,
98
attrs: {
109
title: 'Hello World!',
1110
},

0 commit comments

Comments
 (0)