Skip to content

Commit c550980

Browse files
authored
chore: 示例优化,返回支持到首页 (#117)
1 parent 6009c34 commit c550980

File tree

77 files changed

+203
-20
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+203
-20
lines changed

packages/demo/src/mixins/demo-base.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1+
import { goBackOrGoHome } from 'tdesign-uniapp/common/route';
2+
3+
const SHARE_INFO = {
4+
title: 'TDesign UI',
5+
};
6+
7+
18
export default {
9+
onShareAppMessage() {
10+
return SHARE_INFO;
11+
},
12+
onShareTimeline() {
13+
return SHARE_INFO;
14+
},
215
computed: {
316
gCustomNavbarHeight() {
417
let result = 0;
@@ -42,4 +55,9 @@ export default {
4255
}
4356
// #endif
4457
},
58+
methods: {
59+
onDemoGoBack() {
60+
goBackOrGoHome();
61+
},
62+
},
4563
};

packages/demo/src/pages/home/home.vue

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,18 @@ import { list as dataList, skylineList } from './data/index';
6363
import PullDownList from '../../components/pull-down-list/index.vue';
6464
import TrdPrivacy from '../../components/trd-privacy/index.vue';
6565
66+
const SHARE_INFO = {
67+
title: 'TDesign UI',
68+
path: '/pages/home/home',
69+
};
6670
6771
export default {
6872
name: 'Home',
6973
onShareAppMessage() {
70-
return {
71-
title: 'TDesign UI',
72-
path: '/pages/home/home',
73-
};
74+
return SHARE_INFO;
75+
},
76+
onShareTimeline() {
77+
return SHARE_INFO;
7478
},
7579
components: {
7680
TFooter,

packages/tdesign-uniapp-chat/attachments/_example/attachments.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
class="demo-navbar"
55
title="Attachments"
66
left-arrow
7+
:delta="-1"
8+
@go-back="onDemoGoBack"
79
/>
810
<view class="demo">
911
<t-demo-header

packages/tdesign-uniapp-chat/chat-actionbar/_example/chat-actionbar.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
class="demo-navbar"
55
title="ChatActionbar"
66
left-arrow
7+
:delta="-1"
8+
@go-back="onDemoGoBack"
79
/>
810
<view class="demo">
911
<t-demo-header

packages/tdesign-uniapp-chat/chat-content/_example/chat-content.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
class="demo-navbar"
55
title="ChatContent"
66
left-arrow
7+
:delta="-1"
8+
@go-back="onDemoGoBack"
79
/>
810
<view class="demo">
911
<t-demo-header

packages/tdesign-uniapp-chat/chat-list/_example/chat-list.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
class="demo-navbar"
55
title="ChatList"
66
left-arrow
7+
:delta="-1"
8+
@go-back="onDemoGoBack"
79
/>
810
<view class="demo">
911
<!-- 通过 isActive 为 chatSender 的 value 赋值,避免 textarea 在 ios 上无法被遮挡的问题 -->

packages/tdesign-uniapp-chat/chat-loading/_example/chat-loading.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
class="demo-navbar"
55
title="ChatLoading"
66
left-arrow
7+
:delta="-1"
8+
@go-back="onDemoGoBack"
79
/>
810
<view class="demo">
911
<t-demo-header

packages/tdesign-uniapp-chat/chat-markdown/_example/chat-markdown.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
class="demo-navbar"
55
title="ChatMarkdown"
66
left-arrow
7+
:delta="-1"
8+
@go-back="onDemoGoBack"
79
/>
810
<view class="demo">
911
<t-demo-header

packages/tdesign-uniapp-chat/chat-message/_example/chat-message.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
class="demo-navbar"
55
title="ChatMessage"
66
left-arrow
7+
:delta="-1"
8+
@go-back="onDemoGoBack"
79
/>
810
<view class="demo">
911
<t-demo-header

packages/tdesign-uniapp-chat/chat-sender/_example/chat-sender.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
class="demo-navbar"
55
title="ChatSender"
66
left-arrow
7+
:delta="-1"
8+
@go-back="onDemoGoBack"
79
/>
810
<view class="demo">
911
<t-demo-header

0 commit comments

Comments
 (0)