naive-ui/demo/documentation/components/confirm/enUS/useComponent.md
2020-02-04 13:23:36 +08:00

574 B

Use as a Component

Sometimes you may want to use a component.

<n-confirm
  title="Confirm"
  content="Are you sure?" 
  :closable="false"
  positive-text="Submit"
  @positive-click="submitCallback"
  @negative-click="cancelCallback"
  negative-text="Cancel">
</n-confirm>
export default {
  methods: {
    cancelCallback () {
      this.$NMessage.waning('Cancel')
      this.isActive = false
    },
    submitCallback () {
      this.$NMessage.success('Submit')
      this.isActive = false
    }
  }
}
.n-button {
  margin: 0 12px 8px 0;
}