Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

121 lignes
3.5 KiB

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