mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-12 12:25:16 +08:00
487001d697
.demo.md for component demo .demo-entry.md for demo entry .md for common docs
38 lines
616 B
Markdown
38 lines
616 B
Markdown
# 基础用法
|
|
Modal 的基础用法,你可以把任何东西放进去,比如一个卡片。
|
|
```html
|
|
<n-button
|
|
@click="modalActive = true"
|
|
>
|
|
来吧
|
|
</n-button>
|
|
<n-modal v-model="modalActive">
|
|
<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 {
|
|
modalActive: false
|
|
}
|
|
}
|
|
}
|
|
``` |