naive-ui/demo/documentation/components/confirm/enUS/useComponent.demo.md
07akioni 487001d697 build: add changelog to site, refactor loader based on suffix
.demo.md for component demo
.demo-entry.md for demo entry
.md for common docs
2020-08-19 23:30:04 +08:00

584 B

Use as a Component

Sometimes you may want to use a component.

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