title.textStyle.rich   |   Object

在 rich 里面,可以自定义富文本样式。利用富文本样式,可以在标签中做出非常丰富的效果。

例如:label: {

normal: {

// 在文本中,可以对部分文本采用 rich 中定义样式。

// 这里需要在文本中使用标记符号:

// `{styleName|text content text content}` 标记样式名。

// 注意,换行仍是使用 '\n'。

formatter: [

'{a|这段文本采用样式a}',

'{b|这段文本采用样式b}这段用默认样式{x|这段用样式x}'

].join('\n'),

rich: {

a: {

color: 'red',

lineHeight: 10

},

b: {

backgroundColor: {

image: 'xxx/xxx.jpg'

},

height: 40

},

x: {

fontSize: 18,

fontFamily: 'Microsoft YaHei',

borderColor: '#449933',

borderRadius: 4

},

...

}

}

}

详情参见教程:富文本标签

title.textStyle.rich.   |   Object

title.textStyle.rich..color   |   Color

[ default: "#fff" ]

文字的颜色。

title.textStyle.rich..fontStyle   |   string

[ default: 'normal' ]

文字字体的风格

可选:'normal'

'italic'

'oblique'

title.textStyle.rich..fontWeight   |   string

[ default: normal ]

文字字体的粗细

可选:'normal'

'bold'

'bolder'

'lighter'

100 | 200 | 300 | 400...

title.textStyle.rich..fontFamily   |   string

[ default: 'sans-serif' ]

文字的字体系列

还可以是 'serif' , 'monospace', 'Arial', 'Courier New', 'Microsoft YaHei', ...

title.textStyle.rich..fontSize    |   number

[ default: 12 ]

文字的字体大小

title.textStyle.rich..align   |  string

文字水平对齐方式,默认自动。

可选:'left'

'center'

'right'

rich 中如果没有设置 align,则会取父层级的 align。例如:{

align: right,

rich: {

a: {

// 没有设置 `align`,则 `align` 为 right

}

}

}

title.textStyle.rich..verticalAlign   |   string

文字垂直对齐方式,默认自动。

可选:'top'

'middle'

'bottom'

rich 中如果没有设置 verticalAlign,则会取父层级的 verticalAlign。例如:{

verticalAlign: bottom,

rich: {

a: {

// 没有设置 `verticalAlign`,则 `verticalAlign` 为 bottom

}

}

}

title.textStyle.rich..lineHeight   |   number

行高。

rich 中如果没有设置 lineHeight,则会取父层级的 lineHeight。例如:{

lineHeight: 56,

rich: {

a: {

// 没有设置 `lineHeight`,则 `lineHeight` 为 56

}

}

}

title.textStyle.rich..backgroundColor    |    string, Object

[ default: 'transparent' ]

文字块背景色。

可以是直接的颜色值,例如:'#123234', 'red', rgba(0,23,11,0.3)'。

可以支持使用图片,例如:backgroundColor: {

image: 'xxx/xxx.png'

// 这里可以是图片的 URL,

// 或者图片的 dataURI,

// 或者 HTMLImageElement 对象,

// 或者 HTMLCanvasElement 对象。

}

当使用图片的时候,可以使用 width 或 height 指定高宽,也可以不指定自适应。

title.textStyle.rich..borderColor    |   string

[ default: 'transparent' ]

文字块边框颜色。

title.textStyle.rich..borderWidth    |   number

[ default: 0 ]

文字块边框宽度。

title.textStyle.rich..borderRadius    |   number, Array

[ default: 0 ]

文字块的圆角。

title.textStyle.rich..padding    |   number, Array

[ default: 0 ]

文字块的内边距。例如:padding: [3, 4, 5, 6]:表示 [上, 右, 下, 左] 的边距。

padding: 4:表示 padding: [4, 4, 4, 4]。

padding: [3, 4]:表示 padding: [3, 4, 3, 4]。

注意,文字块的 width 和 height 指定的是内容高宽,不包含 padding。

title.textStyle.rich..shadowColor    |   string

[ default: 'transparent' ]

文字块的背景阴影颜色。

title.textStyle.rich..shadowBlur    |    number

[ default: 0 ]

文字块的背景阴影长度。

title.textStyle.rich..shadowOffsetX    |    number

[ default: 0 ]

文字块的背景阴影 X 偏移。

title.textStyle.rich..shadowOffsetY   |   number

[ default: 0 ]

文字块的背景阴影 Y 偏移。

title.textStyle.rich..width    |    number, string

文字块的宽度。一般不用指定,不指定则自动是文字的宽度。在想做表格项或者使用图片(参见 backgroundColor)时,可能会使用它。

注意,文字块的 width 和 height 指定的是内容高宽,不包含 padding。

width 也可以是百分比字符串,如 '100%'。表示的是所在文本块的 contentWidth(即不包含文本块的 padding)的百分之多少。之所以以 contentWidth 做基数,因为每个文本片段只能基于 content box 布局。如果以 outerWidth 做基数,则百分比的计算在实用中不具有意义,可能会超出。

注意,如果不定义 rich 属性,则不能指定 width 和 height。

title.textStyle.rich..height   |   number, string

文字块的高度。一般不用指定,不指定则自动是文字的高度。在使用图片(参见 backgroundColor)时,可能会使用它。

注意,文字块的 width 和 height 指定的是内容高宽,不包含 padding。

注意,如果不定义 rich 属性,则不能指定 width 和 height。

title.textStyle.rich..textBorderColor   |   string

[ default: 'transparent' ]

文字本身的描边颜色。

title.textStyle.rich..textBorderWidth   |   number

[ default: 0 ]

文字本身的描边宽度。

title.textStyle.rich..textShadowColor   |   string

[ default: 'transparent' ]

文字本身的阴影颜色。

title.textStyle.rich..textShadowBlur   |   number

[ default: 0 ]

文字本身的阴影长度。

title.textStyle.rich..textShadowOffsetX    |   number

[ default: 0 ]

文字本身的阴影 X 偏移。

title.textStyle.rich..textShadowOffsetY   |   number

[ default: 0 ]

文字本身的阴影 Y 偏移。

echart添加文本_ECharts自定义富文本相关推荐

  1. Vue 自定义富文本编辑器 tinymce 支持导入 word 模板

    自定义富文本编辑器分为前端项目和后端项目两个部分,首先先说一下前端项目 前端 前端项目地址: https://github.com/haoxiaoyong1014/editor-ui 编辑器名称: t ...

  2. unity学习笔记-text文本识别html富文本(待改进)

    unity学习笔记 text文本识别html富文本(待改进) 需求 逻辑 实现 xlua的安装 配置到unity 使用 改进优化(待改进) text文本识别html富文本(待改进) 需求 项目里需要将 ...

  3. quilleditor 字体大小设置_Quill 自定义富文本功能

    前言 富文本是给输入的内容增加样式,Quill 提供 api 的方式去判断修改 DOM ,而不像很多其他的编辑器通过遍历 DOM 树的方式来做到这点.并且 Quill 支持定制化功能,接下来来了解下如 ...

  4. 【wangEditor富文本编辑器】富文本三种使用方法,html使用富文本,html套vue脚手架使用富文本,vue使用富文本【简单易用,复制即用】

    前言 富文本编辑器功能是很多人都要使用的 市面上有很多的编辑器可以供选择,但是很多编辑器会有点复杂,或者文档看起来难受. 我最近做了一个需求,是需要在html文件上写富文本编辑器. 但是我看了以前用的 ...

  5. 富文本编辑器 mysql_富文本编辑器汇总

    富文本编辑器,Rich Text Editor, 简称 RTE, 它提供类似于 Microsoft Word 的编辑功能,容易被不会编写 HTML 的用户并需要设置各种文本格式的用户所喜爱. 它的原理 ...

  6. kind富文本编辑器_富文本编辑器原理探索

    经常在做企业网站的管理系统的时候需要用到富文本编辑器,之前基本上都是直接去 npm 或者 github 上面搜找一些排名考前或者 readme 写的好的库,直接拿来用.万变不离其宗,是时候探索下本质了 ...

  7. android 富文本编辑器_富文本编辑器原理探索

    经常在做企业网站的管理系统的时候需要用到富文本编辑器,之前基本上都是直接去 npm 或者 github 上面搜找一些排名考前或者 readme 写的好的库,直接拿来用.万变不离其宗,是时候探索下本质了 ...

  8. android 富文本编辑器_富文本编辑器,还是Tinymce好一点?Angular/Vue集成最新版

    以前jQuery.PC网页时代,富文本编辑器一直就是百度Ueditor.KindEditor.现在使用Angular.Vue.React等MVVM架构以及最新的大前端 工程模式下,老的编辑器显然不更新 ...

  9. java 富文本 word_Java导出富文本到word

    源码地址: 背景 最近用java开发一个中车项目管理系统,里面有一个维修单word导出功能. 可用方案 在网上查找资料,总结出两种比较可行的方案. (1) 制作word模板,导出成mht文件(单页面网 ...

  10. uni-app 富文本 小程序 富文本 (微信小程序、支付宝小程序、百度小程序)直接套用pc端富文本问题解析

    微信跟百度 直接使用 u-parse组件,效果还是不错的,注意一点是a标签的复制提示语,自己需要uni.hideLoading()一下,再重置. 支付宝相对复杂一点,采用原生rich-text 标签, ...

最新文章

  1. EBS-使用 fnd_user_pkg API 创建用户,添加职责,修改用户
  2. 记录一次frp失效bug
  3. php7.0 + mysql5.7.10 + nginx7.0 web开发环境搭建(CentOS7)
  4. push to origin/master was rejected错误解决方案
  5. 使用VC++绘制坐标系
  6. pandas 笔记:合并操作
  7. 一名 40 岁“老”程序员的反思~
  8. [AWS vs Azure] 云计算里AWS和Azure的探究(5) ——EC2和Azure VM磁盘性能分析
  9. mybatis分页插件PageHelper简单应用
  10. 2019ICPC(上海) - Color Graph(二分图+状态压缩)
  11. JS字符转为json对象
  12. 离职后前公司老大叫我回去帮忙,怎么委婉拒绝?
  13. 努比亚红魔play9008救砖教程
  14. 国内外各大免费收录网站搜索引擎及导航网址提交入口
  15. postman常用断言
  16. CS5298 Type-C/DP1.4 到 HDMI 2.1转换芯片|TYPEC转HDMI2.1转换芯片|DP1.4转HDMI2.1转换芯片
  17. Excerpt-16 March, 2019
  18. ocdma相干非相干_相干成像和非相干成像有什么区别?
  19. DataGear 自定义数据可视化图表
  20. 离散数学——图论中图的同构的应用

热门文章

  1. 《数据结构》第五章 树和二叉树 同学问题收集站
  2. 血浆/血清RNA提取试剂盒的功能和特色
  3. 养花追美女的java游戏,小米有品上架懒人鱼缸:上面养花 下面养鱼
  4. attitude determines altitude 态度决定高度
  5. 《MySQL数据操作与查询》- 综合项目 - 学生管理系统
  6. java提现功能开发_利用java实现提现金额到支付宝账户的功能
  7. 施一公:如何写好一篇学术论文?
  8. Python网络爬虫之网络请求
  9. html的各种标签详解
  10. book mac pro怎么重装系统_苹果13英寸新MacBook Pro怎么重装win7系统