Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/tdesign-uniapp-chat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@

## 文档

[点此查看](https://uwayfly.com/tdesign-uniapp-chat/)
[点此查看](https://tdesign.tencent.com/uniapp-chat/)

## 预览

扫码查看 ↓

<img src="https://cdn.uwayfly.com/tdesign-uniapp/tdesign-uniapp-qrcodes.png?a=3" width="600" />
<img src="https://tdesign.gtimg.com/uniapp/example-qrcode.png" width="600" />

> 其他平台同样支持,仅因平台审核等原因未能上架预览,不影响组件库正常使用。

Expand Down
2 changes: 1 addition & 1 deletion packages/tdesign-uniapp-chat/site/.env.production
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VUE_APP_PUBLICPATH = https://cdn.uwayfly.com/tdesign-uniapp-chat
VUE_APP_PUBLICPATH = https://static.tdesign.tencent.com/uniapp-chat
36 changes: 18 additions & 18 deletions packages/tdesign-uniapp-chat/site/docs.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@ export const docs = [
titleEn: 'Getting Started',
name: 'getting-started',
meta: { docType: 'explain' },
path: '/tdesign-uniapp-chat/getting-started',
path: '/uniapp-chat/getting-started',
component: () => import('@docs/getting-started.md'),
},
{
title: '更新日志',
titleEn: 'CHANGELOG',
name: 'changelog',
path: '/tdesign-uniapp-chat/changelog',
path: '/uniapp-chat/changelog',
component: () => import('../CHANGELOG.md'),
},
{
title: '常见问题',
titleEn: 'FAQ',
name: 'faq',
path: '/tdesign-uniapp-chat/faq',
path: '/uniapp-chat/faq',
component: () => import('@docs/faq.md'),
},
{
title: '什么是流式输出',
name: 'sse',
path: '/tdesign-uniapp-chat/sse',
path: '/uniapp-chat/sse',
component: () => import('@docs/sse.md'),
},
],
Expand All @@ -44,23 +44,23 @@ export const docs = [
titleEn: 'Custom Style',
name: 'custom-style',
meta: { docType: 'explain' },
path: '/tdesign-uniapp-chat/custom-style',
path: '/uniapp-chat/custom-style',
component: () => import('@docs/custom-style.md'),
},
{
title: '自定义主题',
titleEn: 'Custom Theme',
name: 'custom-theme',
meta: { docType: 'explain' },
path: '/tdesign-uniapp-chat/custom-theme',
path: '/uniapp-chat/custom-theme',
component: () => import('@docs/custom-theme.md'),
},
{
title: '深色模式',
titleEn: 'Dark Mode',
name: 'dark-mode',
meta: { docType: 'explain' },
path: '/tdesign-uniapp-chat/dark-mode',
path: '/uniapp-chat/dark-mode',
component: () => import('@docs/dark-mode.md'),
},
],
Expand All @@ -74,39 +74,39 @@ export const docs = [
titleEn: 'ChatList',
name: 'ChatList 对话列表',
meta: { docType: 'base' },
path: '/tdesign-uniapp-chat/components/chat-list',
path: '/uniapp-chat/components/chat-list',
component: () => import('@/chat-list/README.md'),
},
{
title: 'ChatSender 对话输入',
titleEn: 'ChatSender',
name: 'ChatSender 对话输入',
meta: { docType: 'base' },
path: '/tdesign-uniapp-chat/components/chat-sender',
path: '/uniapp-chat/components/chat-sender',
component: () => import('@/chat-sender/README.md'),
},
{
title: 'ChatMessage 对话消息体',
titleEn: 'ChatMessage',
name: 'ChatMessage 对话消息体',
meta: { docType: 'base' },
path: '/tdesign-uniapp-chat/components/chat-message',
path: '/uniapp-chat/components/chat-message',
component: () => import('@/chat-message/README.md'),
},
{
title: 'ChatActionbar 对话操作',
titleEn: 'ChatActionbar',
name: 'ChatActionbar 对话操作',
meta: { docType: 'base' },
path: '/tdesign-uniapp-chat/components/chat-actionbar',
path: '/uniapp-chat/components/chat-actionbar',
component: () => import('@/chat-actionbar/README.md'),
},
{
title: 'ChatMarkdown Markdown内容',
titleEn: 'ChatMarkdown',
name: 'ChatMarkdown Markdown内容',
meta: { docType: 'base' },
path: '/tdesign-uniapp-chat/components/chat-markdown',
path: '/uniapp-chat/components/chat-markdown',
component: () => import('@/chat-markdown/README.md'),
componentEn: () => import('@/chat-markdown/README.en-US.md'),
},
Expand All @@ -115,7 +115,7 @@ export const docs = [
titleEn: 'ChatThinking',
name: 'ChatThinking 思考过程',
meta: { docType: 'base' },
path: '/tdesign-uniapp-chat/components/chat-thinking',
path: '/uniapp-chat/components/chat-thinking',
component: () => import('@/chat-thinking/README.md'),
componentEn: () => import('@/chat-thinking/README.en-US.md'),
},
Expand All @@ -124,7 +124,7 @@ export const docs = [
titleEn: 'ChatLoading',
name: 'ChatLoading 对话加载',
meta: { docType: 'base' },
path: '/tdesign-uniapp-chat/components/chat-loading',
path: '/uniapp-chat/components/chat-loading',
component: () => import('@/chat-loading/README.md'),
componentEn: () => import('@/chat-loading/README.en-US.md'),
},
Expand All @@ -133,7 +133,7 @@ export const docs = [
titleEn: 'Attachments',
name: 'Attachments 文件附件',
meta: { docType: 'base' },
path: '/tdesign-uniapp-chat/components/attachments',
path: '/uniapp-chat/components/attachments',
component: () => import('@/attachments/README.md'),
componentEn: () => import('@/attachments/README.en-US.md'),
},
Expand All @@ -142,18 +142,18 @@ export const docs = [
titleEn: 'ChatContent',
name: 'ChatContent 对话正文',
meta: { docType: 'base' },
path: '/tdesign-uniapp-chat/components/chat-content',
path: '/uniapp-chat/components/chat-content',
component: () => import('@/chat-content/README.md'),
componentEn: () => import('@/chat-content/README.en-US.md'),
},
],
},
];

export const enDocs = docs.map(doc => ({
export const enDocs = docs.map((doc) => ({
...doc,
title: doc.titleEn || '',
children: doc?.children?.map(child => ({
children: doc?.children?.map((child) => ({
title: child.titleEn || '',
name: `${child.name}-en`,
path: `${child.path}-en`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spline: explain
Please use WeChat to scan the QR code to preview the TDesign UniApp example. ↓
<br/>

<img src="https://cdn.uwayfly.com/tdesign-uniapp/tdesign-uniapp-qrcodes.png?a=3" width="600" />
<img src="https://tdesign.gtimg.com/uniapp/example-qrcode.png" width="600" />

## Before use

Expand Down Expand Up @@ -86,7 +86,7 @@ Minimum base library version `^2.12.0`
### Correspondence between component and basic library versions

| 组件 | API | 最低基础库 | 描述 |
| -- | -- | -- | -- |
| -- | -- | -- | -- |
| Upload | [wx.previewMedia](https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.previewMedia.html) | 2.12.0 | - |
| Upload | [wx.chooseMedia](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.chooseMedia.html) | 2.10.0 | - |
| Upload | [wx.chooseMessageFile](https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.chooseMessageFile.html) | 2.5.0 | - |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spline: explain

扫码查看 ↓

<img src="https://cdn.uwayfly.com/tdesign-uniapp/tdesign-uniapp-qrcodes.png?a=3" width="600" />
<img src="https://tdesign.gtimg.com/uniapp/example-qrcode.png" width="600" />

> 其他平台同样支持,仅因平台审核等原因未能上架预览,不影响组件库正常使用。

Expand Down
66 changes: 32 additions & 34 deletions packages/tdesign-uniapp-chat/site/index.html
Original file line number Diff line number Diff line change
@@ -1,38 +1,36 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<link rel="icon" href="/favicon.ico" />
<title>TDesign</title>
<!--[if lte IE 9]>
<style>
#app {
display: none;
}
</style>
<![endif]-->
<style>
td-doc-phone {
--phone-body-height: 667px !important;
}
</style>
</head>

<head>
<meta charset="UTF-8">
<link rel="icon"
href="https://mike-1255355338.cos.ap-guangzhou.myqcloud.com/article/2025/10/own_mike_tYYDt364MCtSXHsn.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="icon" href="/favicon.ico">
<title>TDesign</title>
<!--[if lte IE 9]>
<style>
#app {
display: none;
}
</style>
<![endif]-->
<style>
td-doc-phone {
--phone-body-height: 667px !important;
}
</style>
</head>

<body>
<!--[if lte IE 9]>
<h1 style="position: absolute; width: 100%; text-align:center; top: 45%">请使用 IE 10 以及更新版本的浏览器访问,建议使用 <a href="https://www.google.cn/chrome/">Chrome</a></h1>
<![endif]-->

<td-stats></td-stats>
<div id="app">
<app></app>
</div>
<script type="module" src="./web/main.ts"></script>
</body>
<body>
<!--[if lte IE 9]>
<h1 style="position: absolute; width: 100%; text-align: center; top: 45%"
>请使用 IE 10 以及更新版本的浏览器访问,建议使用 <a href="https://www.google.cn/chrome/">Chrome</a></h1
>
<![endif]-->

<td-stats></td-stats>
<div id="app">
<app></app>
</div>
<script type="module" src="./web/main.ts"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion packages/tdesign-uniapp-chat/site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"version": "0.0.1",
"description": "site of tdesign-uniapp-chat",
"author": "novlan1",
"homepage": "https://uwayfly.com/tdesign-uniapp/",
"homepage": "https://tdesign.tencent.com/uniapp/",
"bugs": {
"url": "https://github.com/Tencent/tdesign-miniprogram/issues"
},
Expand Down
52 changes: 34 additions & 18 deletions packages/tdesign-uniapp-chat/site/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ import vueJsx from '@vitejs/plugin-vue-jsx';
// import changelog2Json from './web/plugins/changelog-to-json';
import tdocPlugin from './web/plugins/plugin-tdoc';

const resolvePath = r => path.resolve(__dirname, r);
const resolvePath = (r) => path.resolve(__dirname, r);

const publicPathMap = {
preview: '/',
production: '/tdesign-uniapp-chat/',
production: 'https://static.tdesign.tencent.com/uniapp-chat/',
};

const isCustomElement = tag => tag.startsWith('td-');
const isCustomElement = (tag) => tag.startsWith('td-');

// Rollup 4+ 的 tree-shaking 策略调整, 这里是为了让样式在站点构建正常
const disableTreeShakingPlugin = paths => ({
const disableTreeShakingPlugin = (paths) => ({
name: 'disable-treeshake',
transform(code, id) {
for (const path of paths) {
Expand All @@ -33,20 +33,30 @@ const ENV_PREFIX = ['VITE_', 'VUE_APP'];
export default ({ mode }) => {
const env = loadEnv(mode, root, ENV_PREFIX);
const vueAppBase = env.VUE_APP_PUBLICPATH;
const experimentalConfig = vueAppBase ? {
experimental: {
renderBuiltUrl(filename: string, { hostId, hostType, type }: {
hostId: string;
hostType: string;
type: string;
}) {
console.log('[experimental] ', hostType, hostId, type, filename);

return path.join(vueAppBase, filename)
},
},
} : {};
const experimentalConfig = vueAppBase
? {
experimental: {
renderBuiltUrl(
filename: string,
{
hostId,
hostType,
type,
}: {
hostId: string;
hostType: string;
type: string;
},
) {
console.log('[experimental] ', hostType, hostId, type, filename);

// 确保基础路径以 / 结尾
const basePath = vueAppBase.endsWith('/') ? vueAppBase : `${vueAppBase}/`;
return `${basePath}${filename}`;
},
},
}
: {};

const result = defineConfig({
base: publicPathMap[mode],
Expand All @@ -59,10 +69,16 @@ export default ({ mode }) => {
},
},
server: {
host: '0.0.0.0',
host: '127.0.0.1',
port: 19003,
open: '/',
https: false as any,
proxy: {
'/uniapp/live': {
target: 'http://127.0.0.1:11111',
changeOrigin: true,
},
},
},
build: {
outDir: './dist',
Expand Down
Loading
Loading