docs: add teleport link (#9176)

This commit is contained in:
neverland
2021-08-04 10:14:57 +08:00
committed by GitHub
parent d6e5dcb813
commit 46cbdfa8ce
22 changed files with 32 additions and 62 deletions
-16
View File
@@ -98,24 +98,8 @@ Use `teleport` prop to specify mount location.
<!-- teleport to #app -->
<van-popup v-model:show="show" teleport="#app" />
<!-- teleport to Element -->
<van-popup v-model:show="show" :teleport="myContainer" />
```
```js
export default {
setup() {
const myContainer = document.querySelector('.my-container');
return {
myContainer,
};
},
};
```
> Tips: The teleport prop cannot be used on the root node
## API
### Props