basic-usage.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <template>
  2. <el-popover placement="top-start" title="Title" :width="200" trigger="hover" content="this is content, this is content, this is content">
  3. <template #reference>
  4. <el-button>Hover to activate</el-button>
  5. </template>
  6. </el-popover>
  7. <el-popover placement="bottom" title="Title" :width="200" trigger="click" content="this is content, this is content, this is content">
  8. <template #reference>
  9. <el-button>Click to activate</el-button>
  10. </template>
  11. </el-popover>
  12. <el-popover ref="popover" placement="right" title="Title" :width="200" trigger="focus" content="this is content, this is content, this is content">
  13. <template #reference>
  14. <el-button>Focus to activate</el-button>
  15. </template>
  16. </el-popover>
  17. <el-popover ref="popover" title="Title" :width="200" trigger="contextmenu" content="this is content, this is content, this is content">
  18. <template #reference>
  19. <el-button>contextmenu to activate</el-button>
  20. </template>
  21. </el-popover>
  22. <el-popover :visible="visible" placement="bottom" title="Title" :width="200" content="this is content, this is content, this is content">
  23. <template #reference>
  24. <el-button @click="visible = !visible">Manual to activate</el-button>
  25. </template>
  26. </el-popover>
  27. </template>
  28. <script lang="ts" setup>
  29. import { ref } from 'vue'
  30. const visible = ref(false)
  31. </script>