Skip to content

Commit 944de97

Browse files
tweak
1 parent 7d8cd72 commit 944de97

File tree

1 file changed

+38
-20
lines changed

1 file changed

+38
-20
lines changed
Lines changed: 38 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,12 @@
1+
import type { JSX, AnimationBuilder } from "@ionic/core/components";
12
import { defineCustomElement } from "@ionic/core/components/ion-nav.js";
2-
import type { VNode } from "vue";
3+
import type { VNode , PropType } from "vue";
34
import { defineComponent, h, shallowRef } from "vue";
45

56
import { VueDelegate } from "../framework-delegate";
67

7-
export const IonNav = /*@__PURE__*/ defineComponent({
8-
name: "IonNav",
9-
/**
10-
* The default values follow what is defined at
11-
* https://ionicframework.com/docs/api/nav#properties
12-
* otherwise the default values on the Web Component
13-
* may be overridden. For example, if the default animated value
14-
* is not `true` below, then Vue would default the prop to `false`
15-
* which would override the Web Component default of `true`.
16-
*/
17-
props: {
18-
animated: Boolean,
19-
animation: Function,
20-
root: [Function, Object, String],
21-
rootParams: Object,
22-
swipeGesture: Boolean,
23-
},
24-
setup(props) {
8+
export const IonNav = /*@__PURE__*/ defineComponent<JSX.IonNav>(
9+
(props: JSX.IonNav) => {
2510
defineCustomElement();
2611
const views = shallowRef([]);
2712

@@ -39,4 +24,37 @@ export const IonNav = /*@__PURE__*/ defineComponent({
3924
return h("ion-nav", { ...props, delegate }, views.value);
4025
};
4126
},
42-
});
27+
{
28+
name: "IonNav",
29+
/**
30+
* The default values follow what is defined at
31+
* https://ionicframework.com/docs/api/nav#properties
32+
* otherwise the default values on the Web Component
33+
* may be overridden. For example, if the default animated value
34+
* is not `true` below, then Vue would default the prop to `false`
35+
* which would override the Web Component default of `true`.
36+
*/
37+
props: {
38+
animated: {
39+
type: Boolean,
40+
default: true,
41+
},
42+
animation: {
43+
type: Function as unknown as PropType<AnimationBuilder>,
44+
default: undefined,
45+
},
46+
root: {
47+
type: [Function, Object, String],
48+
default: undefined,
49+
},
50+
rootParams: {
51+
type: Object,
52+
default: undefined,
53+
},
54+
swipeGesture: {
55+
type: Boolean,
56+
default: undefined,
57+
},
58+
},
59+
}
60+
);

0 commit comments

Comments
 (0)