Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Accustomed_
hello uni-app x
提交
4b47ae18
H
hello uni-app x
项目概览
Accustomed_
/
hello uni-app x
与 Fork 源项目一致
Fork自
DCloud / hello uni-app x
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
4b47ae18
编写于
8月 31, 2023
作者:
DCloud-yinjiacheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增rich-text示例
上级
c1adbae8
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
410 addition
and
1 deletion
+410
-1
pages.json
pages.json
+18
-0
pages/component/rich-text/rich-text-complex.uvue
pages/component/rich-text/rich-text-complex.uvue
+34
-0
pages/component/rich-text/rich-text-tags.uvue
pages/component/rich-text/rich-text-tags.uvue
+318
-0
pages/component/rich-text/rich-text.uvue
pages/component/rich-text/rich-text.uvue
+39
-0
pages/tabBar/component.uvue
pages/tabBar/component.uvue
+1
-1
未找到文件。
pages.json
浏览文件 @
4b47ae18
...
...
@@ -56,6 +56,24 @@
"navigationBarTitleText"
:
"radio"
}
},
{
"path"
:
"pages/component/rich-text/rich-text"
,
"style"
:
{
"navigationBarTitleText"
:
"rich-text"
}
},
{
"path"
:
"pages/component/rich-text/rich-text-tags"
,
"style"
:
{
"navigationBarTitleText"
:
"rich-text-tags"
}
},
{
"path"
:
"pages/component/rich-text/rich-text-complex"
,
"style"
:
{
"navigationBarTitleText"
:
"rich-text-complex"
}
},
{
"path"
:
"pages/component/checkbox/checkbox"
,
"style"
:
{
...
...
pages/component/rich-text/rich-text-complex.uvue
0 → 100644
浏览文件 @
4b47ae18
<template>
<!-- #ifdef APP -->
<scroll-view>
<!-- #endif -->
<view>
<page-head :title="title"></page-head>
<view class="uni-padding-wrap uni-common-mt">
<rich-text :nodes="htmlString" @itemclick="itemClick"></rich-text>
</view>
</view>
<!-- #ifdef APP -->
</scroll-view>
<!-- #endif -->
</template>
<script>
export default {
data() {
return {
title: 'rich-text-complex',
htmlString: '<p><a href="https://www.dcloud.io/hbuilderx.html">HBuilderX</a><br /><h1>HBuilderX,轻巧、极速,极客编辑器</h1><p style="color:red;"><small>HBuilderX,轻巧、极速,极客编辑器 </small><big>HBuilderX,轻巧、极速,极客编辑器</big><strong>HBuilderX,轻巧、极速,极客编辑器 </strong><i>HBuilderX,轻巧、极速,极客编辑器 </i><u>HBuilderX,轻巧、极速,极客编辑器</u><del>HBuilderX,轻巧、极速,极客编辑器</del></p><h2>uni-app x,终极跨平台方案</h2><p style="background-color: yellow;"><small>uni-app x,终极跨平台方案 </small><big>uni-app x,终极跨平台方案 </big><strong>uni-appx,终极跨平台方案 </strong><i>uni-app x,终极跨平台方案 </i><u>uni-app x,终极跨平台方案 </u><del>uni-app x,终极跨平台方案</del></p><h3>uniCloud,js serverless云服务</h3><p style="text-decoration: line-through;"><small>uniCloud,js serverless云服务 </small><big>uniCloud,js serverless云服务</big><strong>uniCloud,js serverless云服务 </strong><i>uniCloud,js serverless云服务 </i><u>uniCloud,js serverless云服务</u><del>uniCloud,js serverless云服务</del></p><h4>uts,大一统语言</h4><p style="text-align: center;"><small>uts,大一统语言 </small><big>uts,大一统语言 </big><strong>uts,大一统语言 </strong><i>uts,大一统语言</i><u>uts,大一统语言 </u><del>uts,大一统语言</del></p><h5>uniMPSdk,让你的App具备小程序能力</h5><h6>uni-admin,开源、现成的全端管理后台</h6><ul><li style="color: red; text-align: left;">uni-app x,终极跨平台方案</li><li style="color: green; text-align: center;">uni-app x,终极跨平台方案</li><li style="color: blue; text-align: right;">uni-app x,终极跨平台方案</li></ul><a href="https://uniapp.dcloud.net.cn">uni-app</a></p>'
}
},
methods: {
itemClick(e : RichTextItemClickEvent) {
console.log(JSON.stringify(e.detail));
}
}
}
</script>
<style>
</style>
\ No newline at end of file
pages/component/rich-text/rich-text-tags.uvue
0 → 100644
浏览文件 @
4b47ae18
<template>
<!-- #ifdef APP -->
<scroll-view>
<!-- #endif -->
<view>
<page-head :title="title"></page-head>
<view class="uni-padding-wrap uni-common-mt">
<view class="uni-title">
<text class="uni-title-text">支持的HTML标签</text>
</view>
<view class="uni-common-mt" v-for="(item,index) in data" :key="index">
<text class="uni-subtitle-text">{{item.name}}</text>
<view style="background:#FFFFFF;">
<rich-text :nodes="item.html" @itemclick="itemClick"></rich-text>
</view>
</view>
</view>
</view>
<!-- #ifdef APP -->
</scroll-view>
<!-- #endif -->
</template>
<script>
export default {
data() {
return {
title: 'rich-text-tags',
data: [
{
name: '<br/>',
html: [
{
name: 'br',
children: [
{
type: 'text',
text: 'hello uni-app x'
}
]
},
{
name: 'br'
}
] as Array<UTSJSONObject>
},
{
name: '<p/>',
html: [
{
name: 'p',
attrs: {
style: 'text-align: center; text-decoration: line-through;'
},
children: [
{
type: 'text',
text: 'hello uni-app x'
}
]
},
{
name: 'p',
attrs: {
style: 'background-color: green; color: red;'
},
children: [
{
type: 'text',
text: 'hello uni-app x'
}
]
}
] as Array<UTSJSONObject>
},
{
name: '<ul/> <li/>',
html: [
{
name: 'ul',
children: [
{
name: 'li',
attrs: {
style: 'text-decoration: line-through; text-align: center;'
},
children: [
{
type: 'text',
text: 'hello uni-app x'
}
]
},
{
name: 'li',
attrs: {
style: 'color: red; background-color: green; text-align: center;'
},
children: [
{
type: 'text',
text: 'hello uni-app x'
}
]
}
],
}
] as Array<UTSJSONObject>
},
{
name: '<span/>',
html: [
{
name: 'span',
attrs: {
style: 'color: red; background-color: green; text-decoration: line-through;'
},
children: [
{
type: 'text',
text: 'hello uni-app x'
}
]
}
] as Array<UTSJSONObject>
},
{
name: '<strong/>',
html: [
{
name: 'strong',
children: [
{
type: 'text',
text: 'hello uni-app x'
}
]
}
] as Array<UTSJSONObject>
},
{
name: '<i/>',
html: [
{
name: 'i',
children: [
{
type: 'text',
text: 'hello uni-app x'
}
]
}
] as Array<UTSJSONObject>
},
{
name: '<big/>',
html: [
{
name: 'big',
children: [
{
type: 'text',
text: 'hello uni-app x'
}
]
}
] as Array<UTSJSONObject>
},
{
name: '<small/>',
html: [
{
name: 'small',
children: [
{
type: 'text',
text: 'hello uni-app x'
}
]
}
] as Array<UTSJSONObject>
},
{
name: '<a/>',
html: [
{
name: 'a',
attrs: {
href: 'https://www.baidu.com'
},
children: [
{
type: 'text',
text: '百度'
}
]
}
] as Array<UTSJSONObject>
},
{
name: '<u/>',
html: [
{
name: 'u',
children: [
{
type: 'text',
text: 'hello uni-app x'
}
]
}
] as Array<UTSJSONObject>
},
{
name: '<del/>',
html: [
{
name: 'del',
children: [
{
type: 'text',
text: 'hello uni-app x'
}
]
}
] as Array<UTSJSONObject>
},
{
name: '<h1/> <h2/> <h3/> <h4/> <h5/> <h6/>',
html: [
{
name: 'h1',
children: [
{
type: 'text',
text: 'hello uni-app x'
}
]
},
{
name: 'h2',
children: [
{
type: 'text',
text: 'hello uni-app x'
}
]
},
{
name: 'h3',
children: [
{
type: 'text',
text: 'hello uni-app x'
}
]
},
{
name: 'h4',
children: [
{
type: 'text',
text: 'hello uni-app x'
}
]
},
{
name: 'h5',
children: [
{
type: 'text',
text: 'hello uni-app x'
}
]
},
{
name: 'h6',
children: [
{
type: 'text',
text: 'hello uni-app x'
}
]
}
] as Array<UTSJSONObject>
},
{
name: '<img/>',
html: [
{
name: 'img',
attrs: {
src: 'https://web-assets.dcloud.net.cn/unidoc/zh/uni@2x.png',
width: '100px',
height: '100px'
}
}
] as Array<UTSJSONObject>
}
] as Array<TagInfo>
}
},
methods: {
itemClick(e : RichTextItemClickEvent) {
console.log(JSON.stringify(e.detail));
}
}
}
type TagInfo = {
name : string,
html : Array<UTSJSONObject>
}
</script>
<style>
</style>
\ No newline at end of file
pages/component/rich-text/rich-text.uvue
0 → 100644
浏览文件 @
4b47ae18
<template>
<view>
<page-head :title="title"></page-head>
<view class="uni-padding-wrap uni-common-mt">
<view class="uni-btn-v">
<button type="primary" @tap="singleTag">rich-text渲染单个HTML标签示例</button>
</view>
<view class="uni-btn-v">
<button type="primary" @tap="complexTags">rich-text渲染复杂HTML示例</button>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: 'rich-text'
}
},
methods: {
singleTag() {
uni.navigateTo({
url: '/pages/component/rich-text/rich-text-tags'
});
},
complexTags() {
uni.navigateTo({
url: '/pages/component/rich-text/rich-text-complex'
});
}
}
}
</script>
<style>
</style>
\ No newline at end of file
pages/tabBar/component.uvue
浏览文件 @
4b47ae18
...
...
@@ -110,7 +110,7 @@ export default {
},
{
name: 'rich-text',
enable:
fals
e,
enable:
tru
e,
},
{
name: 'progress',
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录