mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-12 12:25:16 +08:00
39 lines
619 B
Markdown
39 lines
619 B
Markdown
|
# 基础用法
|
||
|
Modal 的基础用法,你可以把任何东西放进去,比如一个卡片。
|
||
|
```html
|
||
|
<n-button
|
||
|
size="small"
|
||
|
@click="isActive = true"
|
||
|
>
|
||
|
来
|
||
|
</n-button>
|
||
|
<n-modal v-model="isActive">
|
||
|
<n-card
|
||
|
style="width: 600px;"
|
||
|
title="模态框"
|
||
|
:bordered="false"
|
||
|
size="huge"
|
||
|
:segmented="{
|
||
|
content: 'soft',
|
||
|
footer: 'soft'
|
||
|
}"
|
||
|
>
|
||
|
<template v-slot:header-extra>
|
||
|
噢!
|
||
|
</template>
|
||
|
内容
|
||
|
<template v-slot:footer>
|
||
|
尾部
|
||
|
</template>
|
||
|
</n-card>
|
||
|
</n-modal>
|
||
|
```
|
||
|
```js
|
||
|
export default {
|
||
|
data () {
|
||
|
return {
|
||
|
isActive: false
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
```
|