File tree 1 file changed +10
-17
lines changed
1 file changed +10
-17
lines changed Original file line number Diff line number Diff line change @@ -35,22 +35,6 @@ const attrs = useAttrs<{bar: number}>()
35
35
</script>
36
36
```
37
37
38
- Compiled Output:
39
-
40
- ``` js
41
- export default /* #__PURE__*/ _defineComponent ({
42
- setup (__props , { expose }) {
43
- expose ();
44
-
45
- const attrs = useAttrs< { foo: number }> ()
46
-
47
- return { attrs, useAttrs, ref }
48
- }
49
-
50
- }, { attrs: {} as { foo: number }})"
51
- ```
52
-
53
-
54
38
## Using ` defineCustomElement `
55
39
``` tsx
56
40
const Comp = defineCustomElement ({
@@ -122,7 +106,16 @@ The following below is the design details.
122
106
123
107
## ` useAttrs<T> `
124
108
In the ` setup-script ` , the generic type of ` useAttrs ` will compile to the second param of ` defineComponent ` .
125
- ```ts
109
+
110
+ ``` vue
111
+ <script setup lang="ts">
112
+ const attrs = useAttrs<{bar: number}>()
113
+ </script>
114
+ ```
115
+
116
+ Compiled Output:
117
+
118
+ ``` js
126
119
export default /* #__PURE__*/ _defineComponent ({
127
120
setup (__props , { expose }) {
128
121
expose ();
You can’t perform that action at this time.
0 commit comments