You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

112 lines
3.3 KiB

5 months ago
  1. import { defineMixin } from '../../libs/vue'
  2. import defProps from '../../libs/config/props.js'
  3. export const props = defineMixin({
  4. props: {
  5. // 主题颜色
  6. type: {
  7. type: String,
  8. default: () => defProps.text.type
  9. },
  10. // 是否显示
  11. show: {
  12. type: Boolean,
  13. default: () => defProps.text.show
  14. },
  15. // 显示的值
  16. text: {
  17. type: [String, Number],
  18. default: () => defProps.text.text
  19. },
  20. // 前置图标
  21. prefixIcon: {
  22. type: String,
  23. default: () => defProps.text.prefixIcon
  24. },
  25. // 后置图标
  26. suffixIcon: {
  27. type: String,
  28. default: () => defProps.text.suffixIcon
  29. },
  30. // 文本处理的匹配模式
  31. // text-普通文本,price-价格,phone-手机号,name-姓名,date-日期,link-超链接
  32. mode: {
  33. type: String,
  34. default: () => defProps.text.mode
  35. },
  36. // mode=link下,配置的链接
  37. href: {
  38. type: String,
  39. default: () => defProps.text.href
  40. },
  41. // 格式化规则
  42. format: {
  43. type: [String, Function],
  44. default: () => defProps.text.format
  45. },
  46. // mode=phone时,点击文本是否拨打电话
  47. call: {
  48. type: Boolean,
  49. default: () => defProps.text.call
  50. },
  51. // 小程序的打开方式
  52. openType: {
  53. type: String,
  54. default: () => defProps.text.openType
  55. },
  56. // 是否粗体,默认normal
  57. bold: {
  58. type: Boolean,
  59. default: () => defProps.text.bold
  60. },
  61. // 是否块状
  62. block: {
  63. type: Boolean,
  64. default: () => defProps.text.block
  65. },
  66. // 文本显示的行数,如果设置,超出此行数,将会显示省略号
  67. lines: {
  68. type: [String, Number],
  69. default: () => defProps.text.lines
  70. },
  71. // 文本颜色
  72. color: {
  73. type: String,
  74. default: () => defProps.text.color
  75. },
  76. // 字体大小
  77. size: {
  78. type: [String, Number],
  79. default: () => defProps.text.size
  80. },
  81. // 图标的样式
  82. iconStyle: {
  83. type: [Object, String],
  84. default: () => defProps.text.iconStyle
  85. },
  86. // 文字装饰,下划线,中划线等,可选值 none|underline|line-through
  87. decoration: {
  88. tepe: String,
  89. default: () => defProps.text.decoration
  90. },
  91. // 外边距,对象、字符串,数值形式均可
  92. margin: {
  93. type: [Object, String, Number],
  94. default: () => defProps.text.margin
  95. },
  96. // 文本行高
  97. lineHeight: {
  98. type: [String, Number],
  99. default: () => defProps.text.lineHeight
  100. },
  101. // 文本对齐方式,可选值left|center|right
  102. align: {
  103. type: String,
  104. default: () => defProps.text.align
  105. },
  106. // 文字换行,可选值break-word|normal|anywhere
  107. wordWrap: {
  108. type: String,
  109. default: () => defProps.text.wordWrap
  110. }
  111. }
  112. })