YingXingAI/node_modules/uview-ui/components/u--text/u--text.vue

73 lines
3.3 KiB
Vue
Raw Normal View History

2025-07-10 09:41:17 +08:00
<template>
<uvText
:type="type"
:show="show"
:text="text"
:prefixIcon="prefixIcon"
:suffixIcon="suffixIcon"
:mode="mode"
:href="href"
:format="format"
:call="call"
:openType="openType"
:bold="bold"
:block="block"
:lines="lines"
:color="color"
:decoration="decoration"
:size="size"
:iconStyle="iconStyle"
:margin="margin"
:lineHeight="lineHeight"
:align="align"
:wordWrap="wordWrap"
:customStyle="customStyle"
@click="$emit('click')"
></uvText>
</template>
<script>
/**
* 此组件存在的理由是在nvue下u-text被uni-app官方占用了u-text在nvue中相当于input组件
* 所以在nvue下取名为u--input内部其实还是u-text.vue只不过做一层中转
* 不使用v-bind="$attrs"而是分开独立写传参是因为微信小程序不支持此写法
*/
import uvText from "../u-text/u-text.vue";
import props from "../u-text/props.js";
/**
* Text 文本
* @description 此组件集成了文本类在项目中的常用功能包括状态拨打电话格式化日期*替换超链接...等功能 您大可不必在使用特殊文本时自己定义text组件几乎涵盖您能使用的大部分场景
* @tutorial https://www.uviewui.com/components/loading.html
* @property {String} type 主题颜色
* @property {Boolean} show 是否显示默认 true
* @property {String | Number} text 显示的值
* @property {String} prefixIcon 前置图标
* @property {String} suffixIcon 后置图标
* @property {String} mode 文本处理的匹配模式 text-普通文本price-价格phone-手机号name-姓名date-日期link-超链接
* @property {String} href mode=link下配置的链接
* @property {String | Function} format 格式化规则
* @property {Boolean} call mode=phone时点击文本是否拨打电话默认 false
* @property {String} openType 小程序的打开方式
* @property {Boolean} bold 是否粗体默认normal默认 false
* @property {Boolean} block 是否块状默认 false
* @property {String | Number} lines 文本显示的行数如果设置超出此行数将会显示省略号
* @property {String} color 文本颜色默认 '#303133'
* @property {String | Number} size 字体大小默认 15
* @property {Object | String} iconStyle 图标的样式 默认 {fontSize: '15px'}
* @property {String} decoration 文字装饰下划线中划线等可选值 none|underline|line-through默认 'none'
* @property {Object | String | Number} margin 外边距对象字符串数值形式均可默认 0
* @property {String | Number} lineHeight 文本行高
* @property {String} align 文本对齐方式可选值left|center|right默认 'left'
* @property {String} wordWrap 文字换行可选值break-word|normal|anywhere默认 'normal'
* @event {Function} click 点击触发事件
* @example <u--text text="我用十年青春,赴你最后之约"></u--text>
*/
export default {
name: "u--text",
mixins: [uni.$u.mpMixin, props, uni.$u.mixin],
components: {
uvText,
},
};
</script>