Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d866fcb

Browse files
committedJan 2, 2023
docs: update
1 parent 744be25 commit d866fcb

File tree

1 file changed

+10
-17
lines changed

1 file changed

+10
-17
lines changed
 

‎active-rfcs/0000-infer-attrs.md

+10-17
Original file line numberDiff line numberDiff 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
5640
const Comp = defineCustomElement({
@@ -122,7 +106,16 @@ The following below is the design details.
122106

123107
## `useAttrs<T>`
124108
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
126119
export default /*#__PURE__*/_defineComponent({
127120
setup(__props, { expose }) {
128121
expose();

0 commit comments

Comments
 (0)
Please sign in to comment.