# Use as a Component Sometimes you may want to use a component. ```html ``` ```js export default { methods: { handleNegativeClick () { this.$NMessage.waning('Cancel') this.isActive = false }, handlePositiveClick () { this.$NMessage.success('Confirm') this.isActive = false } } } ``` ```css .n-button { margin: 0 12px 8px 0; } ```