naive-ui/demo/documentation/components/popover/zhCN/trigger.md
2020-01-30 17:38:14 +08:00

903 B

触发方式

<n-popover placement="bottom" trigger="hover" style="margin-right: 12px;">
  <template v-slot:activator>
    <n-button>悬浮</n-button>
  </template>
  <span>
    I wish they all could be California girls
  </span>
</n-popover>
<n-popover :show="showPopover" placement="bottom" trigger="manual">
  <template v-slot:activator>
    <n-button @click="showPopover = !showPopover">
      手动
    </n-button>
  </template>
  <span>
    I wish they all could be California girls
  </span>
</n-popover>
<n-popover placement="bottom" trigger="click" style="margin-right: 12px;">
  <template v-slot:activator>
    <n-button>
      点击
    </n-button>
  </template>
  <span>
    I wish they all could be California girls
  </span>
</n-popover>
export default {
  data() {
    return {
      showPopover: false
    }
  }
}
.n-button {
  margin: 0 12px 8px 0;
}