康巴易测肤/伤疤uniapp小程序类
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.

u--text.vue 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <uvText
  3. :type="type"
  4. :show="show"
  5. :text="text"
  6. :prefixIcon="prefixIcon"
  7. :suffixIcon="suffixIcon"
  8. :mode="mode"
  9. :href="href"
  10. :format="format"
  11. :call="call"
  12. :openType="openType"
  13. :bold="bold"
  14. :block="block"
  15. :lines="lines"
  16. :color="color"
  17. :decoration="decoration"
  18. :size="size"
  19. :iconStyle="iconStyle"
  20. :margin="margin"
  21. :lineHeight="lineHeight"
  22. :align="align"
  23. :wordWrap="wordWrap"
  24. :customStyle="customStyle"
  25. @click="$emit('click')"
  26. ></uvText>
  27. </template>
  28. <script>
  29. /**
  30. * 此组件存在的理由是,在nvue下,u-text被uni-app官方占用了,u-text在nvue中相当于input组件
  31. * 所以在nvue下,取名为u--input,内部其实还是u-text.vue,只不过做一层中转
  32. * 不使用v-bind="$attrs",而是分开独立写传参,是因为微信小程序不支持此写法
  33. */
  34. import uvText from "../u-text/u-text.vue";
  35. import props from "../u-text/props.js";
  36. /**
  37. * Text 文本
  38. * @description 此组件集成了文本类在项目中的常用功能,包括状态,拨打电话,格式化日期,*替换,超链接...等功能。 您大可不必在使用特殊文本时自己定义,text组件几乎涵盖您能使用的大部分场景。
  39. * @tutorial https://www.uviewui.com/components/loading.html
  40. * @property {String} type 主题颜色
  41. * @property {Boolean} show 是否显示(默认 true )
  42. * @property {String | Number} text 显示的值
  43. * @property {String} prefixIcon 前置图标
  44. * @property {String} suffixIcon 后置图标
  45. * @property {String} mode 文本处理的匹配模式 text-普通文本,price-价格,phone-手机号,name-姓名,date-日期,link-超链接
  46. * @property {String} href mode=link下,配置的链接
  47. * @property {String | Function} format 格式化规则
  48. * @property {Boolean} call mode=phone时,点击文本是否拨打电话(默认 false )
  49. * @property {String} openType 小程序的打开方式
  50. * @property {Boolean} bold 是否粗体,默认normal(默认 false )
  51. * @property {Boolean} block 是否块状(默认 false )
  52. * @property {String | Number} lines 文本显示的行数,如果设置,超出此行数,将会显示省略号
  53. * @property {String} color 文本颜色(默认 '#303133' )
  54. * @property {String | Number} size 字体大小(默认 15 )
  55. * @property {Object | String} iconStyle 图标的样式 (默认 {fontSize: '15px'} )
  56. * @property {String} decoration 文字装饰,下划线,中划线等,可选值 none|underline|line-through(默认 'none' )
  57. * @property {Object | String | Number} margin 外边距,对象、字符串,数值形式均可(默认 0 )
  58. * @property {String | Number} lineHeight 文本行高
  59. * @property {String} align 文本对齐方式,可选值left|center|right(默认 'left' )
  60. * @property {String} wordWrap 文字换行,可选值break-word|normal|anywhere(默认 'normal' )
  61. * @event {Function} click 点击触发事件
  62. * @example <u--text text="我用十年青春,赴你最后之约"></u--text>
  63. */
  64. export default {
  65. name: "u--text",
  66. mixins: [uni.$u.mpMixin, props, uni.$u.mixin],
  67. components: {
  68. uvText,
  69. },
  70. };
  71. </script>