index.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <u-alert-tips class="jnpf-alert" :type="type" :title="title" :show-icon="showIcon" :description="description"
  3. :close-able="closable" :close-text="closeText" @close="show=false" :show="show" :title-style="titleStyle"
  4. :desc-style="descStyle" />
  5. </template>
  6. <script>
  7. export default {
  8. name: 'jnpf-alert',
  9. props: {
  10. type: {
  11. type: String,
  12. default: 'success'
  13. },
  14. title: {
  15. type: String,
  16. default: '这是一个提示'
  17. },
  18. tagIcon: {
  19. type: String,
  20. default: 'icon-ym icon-ym-generator-alert'
  21. },
  22. showIcon: {
  23. type: Boolean,
  24. default: false
  25. },
  26. closable: {
  27. type: Boolean,
  28. default: false
  29. },
  30. description: {
  31. type: String,
  32. default: ''
  33. },
  34. closeText: {
  35. type: String,
  36. default: ''
  37. }
  38. },
  39. data() {
  40. return {
  41. show: true,
  42. titleStyle: {
  43. 'word-break': 'break-all',
  44. 'line-height': '34rpx'
  45. },
  46. descStyle: {
  47. 'word-break': 'break-all',
  48. 'line-height': '40rpx',
  49. },
  50. }
  51. }
  52. }
  53. </script>
  54. <style lang="scss">
  55. .jnpf-alert {
  56. width: 100%;
  57. min-height: 72rpx;
  58. }
  59. </style>