Item.vue 877 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <span>
  3. <slot></slot>
  4. </span>
  5. </template>
  6. <script>
  7. export default {
  8. name: 'bm-context-menu-item',
  9. props: {
  10. callback: {
  11. type: Function,
  12. default: function () { }
  13. },
  14. text: {
  15. type: String
  16. },
  17. iconUrl: {
  18. type: String
  19. },
  20. id: {
  21. type: String
  22. },
  23. disabled: {
  24. type: Boolean
  25. },
  26. seperator: {
  27. type: Boolean
  28. },
  29. originInstance: {}
  30. },
  31. methods: {
  32. reload() {
  33. this.$parent.map && this.$parent.load()
  34. }
  35. },
  36. watch: {
  37. text() {
  38. this.reload()
  39. },
  40. iconUrl() {
  41. this.reload()
  42. },
  43. id() {
  44. this.reload()
  45. },
  46. disabled() {
  47. this.reload()
  48. },
  49. iseperator() {
  50. this.reload()
  51. },
  52. callback() {
  53. this.reload()
  54. }
  55. },
  56. destroyed() {
  57. this.reload()
  58. },
  59. mounted() {
  60. this.reload()
  61. }
  62. }
  63. </script>