File tree Expand file tree Collapse file tree 1 file changed +10
-17
lines changed Expand file tree Collapse file tree 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}>()
3535</script>
3636```
3737
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-
5438## Using ` defineCustomElement `
5539``` tsx
5640const Comp = defineCustomElement ({
@@ -122,7 +106,16 @@ The following below is the design details.
122106
123107## ` useAttrs<T> `
124108In 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
126119export default /* #__PURE__*/ _defineComponent ({
127120 setup (__props , { expose }) {
128121 expose ();
You can’t perform that action at this time.
0 commit comments