basic-usage.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <el-popover
  3. placement="top-start"
  4. title="Title"
  5. :width="200"
  6. trigger="hover"
  7. content="this is content, this is content, this is content"
  8. >
  9. <template #reference>
  10. <el-button class="m-2">Hover to activate</el-button>
  11. </template>
  12. </el-popover>
  13. <el-popover
  14. placement="bottom"
  15. title="Title"
  16. :width="200"
  17. trigger="click"
  18. content="this is content, this is content, this is content"
  19. >
  20. <template #reference>
  21. <el-button class="m-2">Click to activate</el-button>
  22. </template>
  23. </el-popover>
  24. <el-popover
  25. ref="popover"
  26. placement="right"
  27. title="Title"
  28. :width="200"
  29. trigger="focus"
  30. content="this is content, this is content, this is content"
  31. >
  32. <template #reference>
  33. <el-button class="m-2">Focus to activate</el-button>
  34. </template>
  35. </el-popover>
  36. <el-popover
  37. ref="popover"
  38. title="Title"
  39. :width="200"
  40. trigger="contextmenu"
  41. content="this is content, this is content, this is content"
  42. >
  43. <template #reference>
  44. <el-button class="m-2">contextmenu to activate</el-button>
  45. </template>
  46. </el-popover>
  47. <el-popover
  48. :visible="visible"
  49. placement="bottom"
  50. title="Title"
  51. :width="200"
  52. content="this is content, this is content, this is content"
  53. >
  54. <template #reference>
  55. <el-button class="m-2" @click="visible = !visible"
  56. >Manual to activate</el-button
  57. >
  58. </template>
  59. </el-popover>
  60. </template>
  61. <script lang="ts" setup>
  62. import { ref } from 'vue'
  63. const visible = ref(false)
  64. </script>
  65. <style scoped>
  66. .el-button + .el-button {
  67. margin-left: 8px;
  68. }
  69. </style>