Skip to content

Commit 5811753

Browse files
committed
feat(chat): 添加skyline渲染支持及滚动优化
1 parent 5513c0f commit 5811753

20 files changed

Lines changed: 176 additions & 32 deletions

File tree

packages/pro-components/chat/attachments/_example/attachments.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"navigationBarTitleText": "Attachments 聊天附件",
3+
"disableScroll": true,
34
"usingComponents": {
45
"base": "./base",
56
"fileLoading": "./file-loading",
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.skyline {
2+
display: flex;
3+
flex-direction: column;
4+
height: 100vh;
5+
6+
.scroll-view {
7+
flex: 1;
8+
height: 0;
9+
}
10+
}

packages/pro-components/chat/attachments/_example/attachments.wxml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
<t-navbar class="demo-navbar" title="Attachments" leftArrow />
2-
<view class="demo">
1+
<view class="skyline">
2+
<t-navbar class="demo-navbar" title="Attachments" leftArrow />
3+
<scroll-view scroll-y type="list" class="scroll-view">
4+
<view class="demo">
35
<t-demo-header
46
title="Attachments 文件附件"
57
desc="用于聊天场景中上传、预览和管理附件的组件。"
@@ -17,4 +19,6 @@
1719
<t-demo desc="文件类型加载状态">
1820
<fileLoading />
1921
</t-demo>
22+
</view>
23+
</scroll-view>
2024
</view>

packages/pro-components/chat/chat-content/_example/chat-content.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"navigationBarTitleText": "ChatContent",
3+
"disableScroll": true,
34
"usingComponents": {
45
"base": "./base"
56
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.skyline {
2+
display: flex;
3+
flex-direction: column;
4+
height: 100vh;
5+
6+
.scroll-view {
7+
flex: 1;
8+
height: 0;
9+
}
10+
}
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
<t-navbar class="demo-navbar" title="ChatContent" leftArrow />
2-
<view class="demo">
1+
<view class="skyline">
2+
<t-navbar class="demo-navbar" title="ChatContent" leftArrow />
3+
<scroll-view scroll-y type="list" class="scroll-view">
4+
<view class="demo">
35
<t-demo-header title="ChatContent 对话正文" desc="支持 markdown 格式的渲染。" notice="渲染框架支持情况:WebView" />
46
<t-demo title="01 组件类型">
57
<base />
68
</t-demo>
9+
</view>
10+
</scroll-view>
711
</view>

packages/pro-components/chat/chat-list/chat-list.wxml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
bindscroll="onScroll"
1313
bindscrolltoupper="handlerScrollToUpper"
1414
bindscrolltolower="handlerScrollToLower"
15+
type="list"
1516
>
1617
<block wx:if="{{reverse}}">
1718
<view class="placeholder"></view>

packages/pro-components/chat/chat-markdown/_example/chat-markdown.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"navigationBarTitleText": "ChatMarkdown 聊天 Markdown 渲染器",
3+
"disableScroll": true,
34
"usingComponents": {
45
"base": "./base",
56
"list": "./list",

packages/pro-components/chat/chat-markdown/_example/chat-markdown.less

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,14 @@
1515
.demo-block__content {
1616
min-height: 200rpx;
1717
}
18+
19+
.skyline {
20+
display: flex;
21+
flex-direction: column;
22+
height: 100vh;
23+
24+
.scroll-view {
25+
flex: 1;
26+
height: 0;
27+
}
28+
}

packages/pro-components/chat/chat-markdown/_example/chat-markdown.wxml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
<t-navbar class="demo-navbar" title="ChatMarkdown" leftArrow />
2-
<view class="demo">
1+
<view class="skyline">
2+
<t-navbar class="demo-navbar" title="ChatMarkdown" leftArrow />
3+
<scroll-view scroll-y type="list" class="scroll-view">
4+
<view class="demo">
35
<t-demo-header
46
title="ChatMarkdown Markdown内容"
57
desc="用于聊天场景中渲染 Markdown 格式文本的组件,内置 marked 解析器,支持多种 Markdown 语法和配置选项。"
@@ -23,4 +25,6 @@
2325
<t-demo title="04 引用">
2426
<refer />
2527
</t-demo>
28+
</view>
29+
</scroll-view>
2630
</view>

0 commit comments

Comments
 (0)