2020-02-05 13:46:47 +08:00
|
|
|
# 基础用法
|
2020-02-04 14:34:56 +08:00
|
|
|
```html
|
2020-02-11 17:19:00 +08:00
|
|
|
<n-button-group>
|
2020-02-08 16:07:25 +08:00
|
|
|
<n-button @click="activate('top')">上</n-button>
|
|
|
|
<n-button @click="activate('right')">右</n-button>
|
|
|
|
<n-button @click="activate('bottom')">下</n-button>
|
|
|
|
<n-button @click="activate('left')">左</n-button>
|
|
|
|
</n-button-group>
|
2020-03-03 19:25:25 +08:00
|
|
|
<n-drawer v-model="active" :width="502" :placement="placement">
|
2020-02-08 16:07:25 +08:00
|
|
|
<n-h1>斯通纳</n-h1>
|
|
|
|
<n-p>《斯通纳》是美国作家约翰·威廉姆斯在 1965 年出版的小说。</n-p>
|
2020-02-04 14:34:56 +08:00
|
|
|
</n-drawer>
|
|
|
|
```
|
|
|
|
```js
|
|
|
|
export default {
|
|
|
|
data () {
|
|
|
|
return {
|
2020-02-08 16:07:25 +08:00
|
|
|
active: false,
|
|
|
|
placement: 'right'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
activate (placement) {
|
|
|
|
this.active = true
|
|
|
|
this.placement = placement
|
2020-02-04 14:34:56 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|