naive-ui/demo/documentation/components/modal/enUS/presetConfirm.md

38 lines
665 B
Markdown
Raw Normal View History

2019-11-15 17:44:43 +08:00
# Use Preset Confirm
2019-11-13 11:40:32 +08:00
```html
<n-button
size="small"
@click="isActive = true"
>
Start Me up
</n-button>
<n-modal v-model="isActive"
preset="confirm"
title="Confirm modal"
content="Are you sure ?"
:closable="false"
2019-11-15 17:44:43 +08:00
positive-text="submit"
@positive-click="cancelCallback"
@negative-click="submitCallback"
negative-text="cancel">
2019-11-13 11:40:32 +08:00
</n-modal>
```
```js
export default {
data () {
return {
isActive: false,
}
},
methods: {
cancelCallback () {
this.$NMessage.success('cancel')
this.isActive = false
},
submitCallback () {
this.$NMessage.success('submit')
this.isActive = false
}
}
}
```