2020-03-05 13:45:45 +08:00
|
|
|
# 使用 Confirm 预设的插槽
|
|
|
|
插槽也会随着预设变动。
|
2020-02-04 14:55:55 +08:00
|
|
|
```html
|
|
|
|
<n-button
|
2020-03-20 12:14:34 +08:00
|
|
|
@click="modalActive = true"
|
2020-02-04 14:55:55 +08:00
|
|
|
>
|
2020-03-05 13:45:45 +08:00
|
|
|
来吧
|
2020-02-04 14:55:55 +08:00
|
|
|
</n-button>
|
2020-03-20 12:14:34 +08:00
|
|
|
<n-modal v-model="modalActive"
|
2020-02-04 14:55:55 +08:00
|
|
|
preset="confirm"
|
|
|
|
title="Confirm"
|
|
|
|
>
|
|
|
|
<template v-slot:header>
|
|
|
|
<div>标题</div>
|
|
|
|
</template>
|
|
|
|
<div>内容</div>
|
|
|
|
<template v-slot:action>
|
|
|
|
<div>操作</div>
|
|
|
|
</template>
|
|
|
|
</n-modal>
|
|
|
|
```
|
|
|
|
```js
|
|
|
|
export default {
|
|
|
|
data () {
|
|
|
|
return {
|
2020-03-20 12:14:34 +08:00
|
|
|
modalActive: false,
|
2020-02-04 14:55:55 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|