docs: add more component registration guide (#9319)

This commit is contained in:
neverland
2021-08-24 10:03:26 +08:00
committed by GitHub
parent b33ef265fe
commit 624d05f749
2 changed files with 56 additions and 0 deletions

View File

@@ -39,6 +39,34 @@ export default {
> For more information, please refer to [Vue.js - Component Registration](https://v3.vuejs.org/guide/component-registration.html#component-registration)。
#### \<script setup\>
Vant components can be used directly in `<script setup>` without component registration.
```xml
<script setup>
import { Button } from 'vant';
</script>
<template>
<Button />
</template>
```
#### JSX/TSX
Vant components can be used directly in JSX and TSX without component registration.
```jsx
import { Button } from 'vant';
export default {
render() {
return <Button />;
},
};
```
## Browser adaptation
### Viewport Units