OperationButton.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <div style="width:auto; display:inline-block !important;">
  3. <a-divider v-if="showDivider" type="vertical" />
  4. <a v-if="type === 1" :style="myStyle" @click="$emit('click')">{{ text == null?$slots.default[0].text : text }}</a>
  5. <a-popconfirm v-if="type === 2" :title="title" @confirm="$emit('confirm')">
  6. <a>{{ text == null?$slots.default[0].text : text }}</a>
  7. </a-popconfirm>
  8. </div>
  9. </template>
  10. <script>
  11. export default {
  12. name: 'OperationButton',
  13. props: {
  14. type: { // 1.表示A标签,2.表示
  15. type: Number,
  16. default: 1
  17. },
  18. text: { // 按钮显示文本
  19. type: String,
  20. default: null
  21. },
  22. showDivider: { // 按钮显示文本
  23. type: Boolean,
  24. default: true
  25. },
  26. title: {
  27. type: String,
  28. default: '亲,开发忘了给提示,请通知管理员杀了祭天'
  29. },
  30. myStyle: {
  31. type: Object,
  32. default: () => ({})
  33. }
  34. },
  35. data () {
  36. return {
  37. }
  38. },
  39. computed: {
  40. },
  41. created () {
  42. },
  43. updated: function () {
  44. }
  45. }
  46. </script>
  47. <style scoped>
  48. </style>