naive-ui/demo/documentation/components/modal/enUS/preset-card.demo.md

38 lines
601 B
Markdown
Raw Normal View History

2019-11-17 00:57:30 +08:00
# Use Preset Card
2020-01-30 22:45:44 +08:00
Modal has some presets, which means you can use props & slots of the preset after set it.
2019-11-17 00:57:30 +08:00
```html
<n-button
@click="modalActive = true"
2019-11-17 00:57:30 +08:00
>
Start Me up
</n-button>
<n-modal
v-model="modalActive"
2019-11-17 00:57:30 +08:00
preset="card"
overlay-style="width: 600px;"
2019-11-17 00:57:30 +08:00
title="Modal"
:bordered="false"
size="huge"
:segmented="{
2019-12-24 22:39:25 +08:00
content: 'soft',
footer: 'soft'
2019-11-17 00:57:30 +08:00
}"
>
<template v-slot:header-extra>
Oops!
</template>
Content
<template v-slot:footer>
Footer
</template>
</n-modal>
```
```js
export default {
data () {
return {
modalActive: false,
2019-11-17 00:57:30 +08:00
}
}
}
```