Python私教张大鹏 Vue3整合AntDesignVue之文本组件

本文主要是介绍Python私教张大鹏 Vue3整合AntDesignVue之文本组件,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

案例:展示标题

核心代码:

<a-typography><a-typography-title>Introduction</a-typography-title>
</a-typography>

vue3示例:

<template><a-typography><a-typography-title>这是一个标题</a-typography-title></a-typography>
</template>

在这里插入图片描述

案例:展示段落

核心代码:

<template><a-typography><a-typography-title>美国新闻稿发布-华尔街日报</a-typography-title><a-typography-paragraph>媒体介绍:华尔街日报(The Wall Street Journal)于1889年创刊,是美国付费发行量最大的财经报纸,其发行量超过200万份。该报出版于美国纽约,主要报道财经新闻,侧重金融商业报道,其影响力巨大。《华尔街日报》的读者大多为政治、经济、教育和医学界人士、金融大亨和经营管理人员以及股票市场的投资者。</a-typography-paragraph></a-typography>

vue3示例:

<template><a-typography><a-typography-title>美国新闻稿发布-华尔街日报</a-typography-title><a-typography-paragraph>媒体介绍:华尔街日报(The Wall StreetJournal)于1889年创刊,是美国付费发行量最大的财经报纸,其发行量超过200万份。该报出版于美国纽约,主要报道财经新闻,侧重金融商业报道,其影响力巨大。《华尔街日报》的读者大多为政治、经济、教育和医学界人士、金融大亨和经营管理人员以及股票市场的投资者。</a-typography-paragraph><a-typography-paragraph>该报出版亚洲版(1976年)、欧洲版(1983年)、网络版(1996年)等,覆盖面广泛且历史悠久,其读者每天超2000万人。《华尔街日报》是美国的高端报纸,读者群的平均家庭年收入达15万美元。针对不同的用户群体有不同的营销策略,为忠实用户推出专业并具有深度的优质新闻内容,为潜在用户提供免费内容资源,独家新闻采取收费。</a-typography-paragraph></a-typography>
</template>

在这里插入图片描述

案例:展示重要内容

核心代码:

<a-typography-text strong>uniform the user interface specs for internal background projects, lower the unnecessarycost of design differences and implementation and liberate the resources of design andfront-end development.
</a-typography-text>

vue3示例:

<template><a-typography><a-typography-title>美国新闻稿发布-华尔街日报</a-typography-title><a-typography-paragraph>媒体介绍:华尔街日报(The Wall StreetJournal)于1889年创刊,是美国付费发行量最大的财经报纸,其发行量超过200万份。该报出版于美国纽约,主要报道财经新闻,侧重金融商业报道,其影响力巨大。《华尔街日报》的读者大多为政治、经济、教育和医学界人士、金融大亨和经营管理人员以及股票市场的投资者。</a-typography-paragraph><a-typography-text strong>该报出版亚洲版(1976年)、欧洲版(1983年)、网络版(1996年)等,覆盖面广泛且历史悠久,其读者每天超2000万人。《华尔街日报》是美国的高端报纸,读者群的平均家庭年收入达15万美元。针对不同的用户群体有不同的营销策略,为忠实用户推出专业并具有深度的优质新闻内容,为潜在用户提供免费内容资源,独家新闻采取收费。</a-typography-text></a-typography>
</template>

在这里插入图片描述

案例:展示二级标题

核心代码:

<a-typography-title :level="2">Guidelines and Resources</a-typography-title>

vue3示例:

<template><a-typography><a-typography-title>美国新闻稿发布-华尔街日报</a-typography-title><a-typography-title :level="2">二级标题</a-typography-title><a-typography-paragraph>媒体介绍:华尔街日报(The Wall StreetJournal)于1889年创刊,是美国付费发行量最大的财经报纸,其发行量超过200万份。该报出版于美国纽约,主要报道财经新闻,侧重金融商业报道,其影响力巨大。《华尔街日报》的读者大多为政治、经济、教育和医学界人士、金融大亨和经营管理人员以及股票市场的投资者。</a-typography-paragraph><a-typography-title :level="2">二级标题</a-typography-title><a-typography-paragraph>该报出版亚洲版(1976年)、欧洲版(1983年)、网络版(1996年)等,覆盖面广泛且历史悠久,其读者每天超2000万人。《华尔街日报》是美国的高端报纸,读者群的平均家庭年收入达15万美元。针对不同的用户群体有不同的营销策略,为忠实用户推出专业并具有深度的优质新闻内容,为潜在用户提供免费内容资源,独家新闻采取收费。</a-typography-paragraph></a-typography>
</template>

在这里插入图片描述

案例:展示代码片段

核心代码:

<a-typography-text code>Sketch</a-typography-text>

vue3示例:

<template><a-typography><a-typography-title>Python代码片段</a-typography-title><a-typography-text code>def add(a, b):return a + bprint(add(11, 22))</a-typography-text></a-typography>
</template>

在这里插入图片描述

案例:展示链接

核心代码:

<a-typography-link href="/docs/resources">Resource Download</a-typography-link>

vue3示例:

<template><a-typography><a-typography-title>友情链接</a-typography-title><a-typography-paragraph>参考链接:<a-typography-link href="http://www.baidu.com">百度</a-typography-link><a-typography-link href="https://www.sohu.com/">搜狐</a-typography-link><a-typography-link href="https://www.sina.com/">新浪</a-typography-link></a-typography-paragraph></a-typography>
</template>

在这里插入图片描述

案例:展示键盘快捷键

核心代码:

<a-typography-text keyboard>Esc</a-typography-text>

vue3示例:

<template><a-typography><a-typography-title>常用快捷键</a-typography-title><a-typography-paragraph><a-typography-text keyboard>ctrl + c</a-typography-text><a-typography-text>复制</a-typography-text></a-typography-paragraph><a-typography-paragraph><a-typography-text keyboard>ctrl + v</a-typography-text><a-typography-text>粘贴</a-typography-text></a-typography-paragraph></a-typography>
</template>
<script setup lang="ts">
</script>

在这里插入图片描述

案例:超过一行变省略号

核心代码:

<a-typography-paragraph:ellipsis="ellipsis"content=" Ant Design, a design language for background applications, is refined by Ant UED Team. AntDesign, a design language for background applications, is refined by Ant UED Team. AntDesign, a design language for background applications, is refined by Ant UED Team. AntDesign, a design language for background applications, is refined by Ant UED Team. AntDesign, a design language for background applications, is refined by Ant UED Team. AntDesign, a design language for background applications, is refined by Ant UED Team."/>

vue3示例:

<template><a-typography><a-typography-title>超过一行变省略号</a-typography-title><a-typography-paragraph ellipsis>该报出版亚洲版(1976年)、欧洲版(1983年)、网络版(1996年)等,覆盖面广泛且历史悠久,其读者每天超2000万人。《华尔街日报》是美国的高端报纸,读者群的平均家庭年收入达15万美元。针对不同的用户群体有不同的营销策略,为忠实用户推出专业并具有深度的优质新闻内容,为潜在用户提供免费内容资源,独家新闻采取收费。</a-typography-paragraph></a-typography>
</template>

在这里插入图片描述

案例:段落可编辑

核心代码:

<a-typography-paragraph v-model:content="editableStr" editable />

vue3示例:

<script setup="">
import {ref} from "vue";const msg = ref("可编辑的文本,不信你试试")
</script>
<template><a-typography><a-typography-title>可编辑的文本</a-typography-title><a-typography-paragraph v-model:content="msg" editable></a-typography-paragraph></a-typography>
</template>
<style scoped></style>

在这里插入图片描述

案例:段落可复制

核心代码:

<a-typography-paragraph :copyable="{ tooltip: false }">Hide Copy tooltips.
</a-typography-paragraph>

vue3示例:

<script setup="">
import {ref} from "vue";const msg=ref("可编辑的文本")
</script>
<template>
<a-typography><a-typography-title>可复制的文本</a-typography-title><a-typography-paragraph copyable>这个文本可以被复制,不信你试试</a-typography-paragraph><a-typography-paragraph v-model:content="msg" editable/>
</a-typography>
</template>
<style scoped></style>

在这里插入图片描述

案例:文本样式

核心代码:

<template><a-space direction="vertical"><a-typography-text>Ant Design Vue (default)</a-typography-text><a-typography-text type="secondary">Ant Design Vue (secondary)</a-typography-text><a-typography-text type="success">Ant Design Vue (success)</a-typography-text><a-typography-text type="warning">Ant Design Vue (warning)</a-typography-text><a-typography-text type="danger">Ant Design Vue (danger)</a-typography-text><a-typography-text disabled>Ant Design Vue (disabled)</a-typography-text><a-typography-text mark>Ant Design Vue (mark)</a-typography-text><a-typography-text code>Ant Design Vue (code)</a-typography-text><a-typography-text keyboard>Ant Design Vue (keyboard)</a-typography-text><a-typography-text underline>Ant Design Vue (underline)</a-typography-text><a-typography-text delete>Ant Design Vue (delete)</a-typography-text><a-typography-text strong>Ant Design Vue (strong)</a-typography-text><a-typography-link href="https://antdv.com" target="_blank">Ant Design Vue (Link)</a-typography-link></a-space>
</template>

vue3示例:

<script setup="">
</script>
<template><a-typography><a-typography-title>文本样式</a-typography-title><a-typography-paragraph><a-typography-text>默认样式</a-typography-text></a-typography-paragraph><a-typography-paragraph><a-typography-text type="secondary">secondary 样式</a-typography-text></a-typography-paragraph><a-typography-paragraph><a-typography-text type="warning">warning 样式</a-typography-text></a-typography-paragraph><a-typography-paragraph><a-typography-text type="success">success 样式</a-typography-text></a-typography-paragraph><a-typography-paragraph><a-typography-text type="danger">danger 样式</a-typography-text></a-typography-paragraph></a-typography>
</template>
<style scoped></style>

在这里插入图片描述

案例:文本划线

核心代码:

<a-typography-text underline>Ant Design Vue (underline)</a-typography-text>
<a-typography-text delete>Ant Design Vue (delete)</a-typography-text>

vue3示例:

<script setup="">
</script>
<template><a-typography><a-typography-title>文本下划线和中划线</a-typography-title><a-typography-paragraph><a-typography-text underline>下划线</a-typography-text></a-typography-paragraph><a-typography-paragraph><a-typography-text delete>中划线,删除线</a-typography-text></a-typography-paragraph></a-typography>
</template>
<style scoped></style>

在这里插入图片描述

案例:文本高亮

核心代码:

<a-typography-text mark>Ant Design Vue (mark)</a-typography-text>

vue3示例:

<script setup="">
</script>
<template><a-typography><a-typography-title>文本高亮</a-typography-title><a-typography-paragraph>该报出版亚洲版(1976年)、欧洲版(1983年)、网络版(1996年)等,覆盖面广泛且历史悠久,其读者每天超2000万人。<a-typography-text mark>《华尔街日报》是美国的高端报纸</a-typography-text>,读者群的平均家庭年收入达15万美元。针对不同的用户群体有不同的营销策略,为忠实用户推出专业并具有深度的优质新闻内容,为潜在用户提供免费内容资源,独家新闻采取收费。</a-typography-paragraph></a-typography>
</template>
<style scoped></style>

在这里插入图片描述

API

Typography.Text

参数说明类型默认值版本
code添加代码样式booleanfalse
content(v-model)当使用 ellipsis 或 editable 时,使用 content 代替 childrenstring-
copyable是否可拷贝,为对象时可进行各种自定义boolean | copyablefalsecopyable
delete添加删除线样式booleanfalse
disabled禁用文本booleanfalse
editable是否可编辑,为对象时可对编辑进行控制boolean | editablefalseeditable
ellipsis自动溢出省略booleanfalse
keyboard添加键盘样式booleanfalse
mark添加标记样式booleanfalse
strong是否加粗booleanfalse
type文本类型secondarysuccesswarning
underline添加下划线样式booleanfalse

Typography.Title

参数说明类型默认值版本
code添加代码样式booleanfalse
content(v-model)当使用 ellipsis 或 editable 时,使用 content 代替 childrenstring-
copyable是否可拷贝,为对象时可进行各种自定义boolean | copyablefalsecopyable
delete添加删除线样式booleanfalse
disabled禁用文本booleanfalse
editable是否可编辑,为对象时可对编辑进行控制boolean | editablefalseeditable
ellipsis自动溢出省略,为对象时可设置省略行数、是否可展开、添加后缀等boolean | ellipsisfalseellipsis
level重要程度,相当于 h1h2h3h4h5number: 1, 2, 3, 4, 51
mark添加标记样式booleanfalse
type文本类型secondarysuccesswarning
underline添加下划线样式booleanfalse

Typography.Paragraph

参数说明类型默认值版本
code添加代码样式booleanfalse
content(v-model)当使用 ellipsis 或 editable 时,使用 content 代替 childrenstring-
copyable是否可拷贝,为对象时可进行各种自定义boolean | copyablefalsecopyable
delete添加删除线样式booleanfalse
disabled禁用文本booleanfalse
editable是否可编辑,为对象时可对编辑进行控制boolean | editablefalseeditable
ellipsis自动溢出省略,为对象时可设置省略行数、是否可展开、添加后缀等boolean | ellipsisfalseellipsis
mark添加标记样式booleanfalse
strong是否加粗booleanfalse
type文本类型secondarysuccesswarning
underline添加下划线样式booleanfalse

slots

名称说明参数默认值版本
copyableIcon自定义拷贝图标{ copied: boolean }copied ? <CheckOutlined /> : <CopyOutlined />
copyableTooltip自定义提示文案,当 copyable.tooltip = false 时关闭{ copied: boolean }copied ? '复制成功' : '复制'
editableIcon自定义编辑图标-
editableTooltip自定义提示文本,当 editable.tooltip = false 时关闭-编辑
ellipsisSymbol自定义展开描述文案--
ellipsisTooltip省略时,展示提示信息--
enterEnterIcon在编辑段中自定义“enter”图标{className: string}<EnterOutlined />3.0

copyable

 {text: string,onCopy: function(event),tooltip: false,}
参数说明类型默认值版本
text拷贝到剪切板里的文本string-
tooltip是否展示提示文本booleantrue
onCopy拷贝成功的回调函数function-

editable

  {tooltip: boolean,editing: boolean,maxlength: number,autoSize: boolean | { minRows: number, maxRows: number },onStart: function,onChange: function(string),onCancel: function,onEnd: function,triggerType: ('icon' | 'text')[],}
参数说明类型默认值版本
autoSize自动 resize 文本域boolean | { minRows: number, maxRows: number }-
editing控制是否是编辑中状态booleanfalse
maxlength编辑中文本域最大长度number-
tooltip是否展示提示文本booleantrue
triggerType编辑模式触发器类型,图标、文本或者两者都设置(不设置图标作为触发器时它会隐藏)Array<icontext>[icon]
onCancel按 ESC 退出编辑状态时触发function-
onChange文本域编辑时触发function(event)-
onEnd按 ENTER 结束编辑状态时触发function-
onStart进入编辑中状态时触发function-

ellipsis

  {rows: number,expandable: boolean,suffix: string,symbol: string,tooltip: boolean,onExpand: function(event),onEllipsis: function(ellipsis),}
参数说明类型默认值版本
expandable是否可展开boolean-
rows最多显示的行数number-
suffix自定义省略内容后缀string-
symbol自定义展开描述文案string展开
tooltip省略时,展示提示信息boolean | string-
onEllipsis触发省略时的回调function(ellipsis)-
onExpand点击展开时的回调function(event)-

这篇关于Python私教张大鹏 Vue3整合AntDesignVue之文本组件的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1039323

相关文章

一文教你Python如何快速精准抓取网页数据

《一文教你Python如何快速精准抓取网页数据》这篇文章主要为大家详细介绍了如何利用Python实现快速精准抓取网页数据,文中的示例代码简洁易懂,具有一定的借鉴价值,有需要的小伙伴可以了解下... 目录1. 准备工作2. 基础爬虫实现3. 高级功能扩展3.1 抓取文章详情3.2 保存数据到文件4. 完整示例

使用Python实现IP地址和端口状态检测与监控

《使用Python实现IP地址和端口状态检测与监控》在网络运维和服务器管理中,IP地址和端口的可用性监控是保障业务连续性的基础需求,本文将带你用Python从零打造一个高可用IP监控系统,感兴趣的小伙... 目录概述:为什么需要IP监控系统使用步骤说明1. 环境准备2. 系统部署3. 核心功能配置系统效果展

基于Python打造一个智能单词管理神器

《基于Python打造一个智能单词管理神器》这篇文章主要为大家详细介绍了如何使用Python打造一个智能单词管理神器,从查询到导出的一站式解决,感兴趣的小伙伴可以跟随小编一起学习一下... 目录1. 项目概述:为什么需要这个工具2. 环境搭建与快速入门2.1 环境要求2.2 首次运行配置3. 核心功能使用指

Python实现微信自动锁定工具

《Python实现微信自动锁定工具》在数字化办公时代,微信已成为职场沟通的重要工具,但临时离开时忘记锁屏可能导致敏感信息泄露,下面我们就来看看如何使用Python打造一个微信自动锁定工具吧... 目录引言:当微信隐私遇到自动化守护效果展示核心功能全景图技术亮点深度解析1. 无操作检测引擎2. 微信路径智能获

Python中pywin32 常用窗口操作的实现

《Python中pywin32常用窗口操作的实现》本文主要介绍了Python中pywin32常用窗口操作的实现,pywin32主要的作用是供Python开发者快速调用WindowsAPI的一个... 目录获取窗口句柄获取最前端窗口句柄获取指定坐标处的窗口根据窗口的完整标题匹配获取句柄根据窗口的类别匹配获取句

利用Python打造一个Excel记账模板

《利用Python打造一个Excel记账模板》这篇文章主要为大家详细介绍了如何使用Python打造一个超实用的Excel记账模板,可以帮助大家高效管理财务,迈向财富自由之路,感兴趣的小伙伴快跟随小编一... 目录设置预算百分比超支标红预警记账模板功能介绍基础记账预算管理可视化分析摸鱼时间理财法碎片时间利用财

Python中的Walrus运算符分析示例详解

《Python中的Walrus运算符分析示例详解》Python中的Walrus运算符(:=)是Python3.8引入的一个新特性,允许在表达式中同时赋值和返回值,它的核心作用是减少重复计算,提升代码简... 目录1. 在循环中避免重复计算2. 在条件判断中同时赋值变量3. 在列表推导式或字典推导式中简化逻辑

python处理带有时区的日期和时间数据

《python处理带有时区的日期和时间数据》这篇文章主要为大家详细介绍了如何在Python中使用pytz库处理时区信息,包括获取当前UTC时间,转换为特定时区等,有需要的小伙伴可以参考一下... 目录时区基本信息python datetime使用timezonepandas处理时区数据知识延展时区基本信息

Python位移操作和位运算的实现示例

《Python位移操作和位运算的实现示例》本文主要介绍了Python位移操作和位运算的实现示例,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一... 目录1. 位移操作1.1 左移操作 (<<)1.2 右移操作 (>>)注意事项:2. 位运算2.1

使用Python和Pyecharts创建交互式地图

《使用Python和Pyecharts创建交互式地图》在数据可视化领域,创建交互式地图是一种强大的方式,可以使受众能够以引人入胜且信息丰富的方式探索地理数据,下面我们看看如何使用Python和Pyec... 目录简介Pyecharts 简介创建上海地图代码说明运行结果总结简介在数据可视化领域,创建交互式地