-
Notifications
You must be signed in to change notification settings - Fork 325
Expand file tree
/
Copy pathindex.vue
More file actions
52 lines (47 loc) · 1.01 KB
/
index.vue
File metadata and controls
52 lines (47 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<template>
<view class="chat-example-block">
<t-chat-markdown
:content="markdownContent"
@click="handleNodeTap"
/>
</view>
</template>
<script>
import TChatMarkdown from '@tdesign/uniapp-chat/chat-markdown/chat-markdown.vue';
const markdownData = `
\`\`\`TDesign-登录表单.jsx
import { Form, Input, Button, Message } from 'tdesign-react';
const LoginForm = () => { const [loading, setLoading] = useState(false);
\`\`\`
`;
export default {
components: {
TChatMarkdown,
},
data() {
return {
markdownContent: markdownData,
};
},
methods: {
handleNodeTap(e) {
const { node } = e;
// 打印节点信息
console.log('节点信息', node);
// 图片节点预览
if (node && node.type === 'image') {
uni.previewImage({
urls: [node.href],
current: node.href,
});
}
},
},
};
</script>
<style>
.chat-example-block {
background-color: var(--td-bg-color-container);
padding: 32rpx;
}
</style>