dropdown.vue 973 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <el-dropdown
  3. placement="bottom"
  4. @command="clickCommand"
  5. >
  6. <el-button
  7. class="el-dropdown-link drop_down"
  8. style="cursor: pointer;"
  9. :size="size"
  10. >
  11. <span class="el-dropdown-link">{{ value }}</span>
  12. <i class="el-icon-arrow-down el-icon--right" />
  13. </el-button>
  14. <el-dropdown-menu slot="dropdown">
  15. <el-dropdown-item
  16. v-for="(item,index) in options"
  17. :key="index"
  18. :command="item"
  19. >{{ item.name }}</el-dropdown-item>
  20. </el-dropdown-menu>
  21. </el-dropdown>
  22. </template>
  23. <script>
  24. export default {
  25. name: 'BugDropDown',
  26. props: {
  27. value: {
  28. type: String,
  29. default: null
  30. },
  31. options: {
  32. type: Array,
  33. default() {
  34. return []
  35. }
  36. },
  37. size: {
  38. type: String,
  39. default: 'medium'
  40. }
  41. },
  42. methods: {
  43. getName() {
  44. },
  45. clickCommand(item) {
  46. this.$emit('command', item)
  47. }
  48. }
  49. }
  50. </script>
  51. <style>
  52. </style>