# 使用组件
有的时候你可能想把它用作一个组件
```html
```
```js
export default {
methods: {
handleNegativeClick () {
this.$NMessage.warning('取消')
this.isActive = false
},
handlePositiveClick () {
this.$NMessage.success('确认')
this.isActive = false
}
}
}
```
```css
.n-button {
margin: 0 12px 8px 0;
}
```