2
0
mirror of https://github.com/tusen-ai/naive-ui.git synced 2025-01-24 12:45:18 +08:00
naive-ui/demo/documentation/components/drawer/zhCN/basic.md

705 B

基础用法

<n-button-group>
  <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>
<n-drawer v-model="active" :width="502" :placement="placement" :z-index="3002">
  <n-h1>斯通纳</n-h1>
  <n-p>《斯通纳》是美国作家约翰·威廉姆斯在 1965 年出版的小说。</n-p>
</n-drawer>
export default {
  data () {
    return {
      active: false,
      placement: 'right'
    }
  },
  methods: {
    activate (placement) {
      this.active = true
      this.placement = placement
    }
  }
}