You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/en/index.md
+41Lines changed: 41 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -586,6 +586,47 @@ Or get `params` on `@beforeOpen` event:
586
586
587
587
<alert>`parmas` will be reset to `{}` automatically after `closed` event. You can avoid the modal to reset the `params` to empty object by calling `event.stop()`.</alert>
588
588
589
+
## TypeScript
590
+
591
+
### Vue
592
+
Works out of the box in Vue, no other settings are required. But if you customized your access key, you must define the type yourself like below:
593
+
594
+
```ts
595
+
importVuefrom'vue'
596
+
importVueFinalModal, {
597
+
VfmOptions,
598
+
VueFinalModalProperty
599
+
} from'vue-final-modal'
600
+
601
+
Vue.use<VfmOptions>(VueFinalModal(), {
602
+
componentName: 'MyComponentName',
603
+
key: 'myKey',
604
+
})
605
+
606
+
// define the type of access key yourself
607
+
declaremodule'vue/types/vue' {
608
+
interfaceVue {
609
+
myKey:VueFinalModalProperty;
610
+
}
611
+
}
612
+
```
613
+
614
+
### Nuxt
615
+
616
+
Add the types to your "types" array in tsconfig.json file
0 commit comments