Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
ai-chat-ui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenghong_tao
ai-chat-ui
Commits
6f9fb590
Commit
6f9fb590
authored
Apr 25, 2025
by
chenghong_tao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update readme and add try catch
parent
b856ece6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
10 deletions
+26
-10
README.md
README.md
+4
-0
markdownRender.vue
src/components/markdown/markdownRender.vue
+22
-10
No files found.
README.md
View file @
6f9fb590
...
...
@@ -10,6 +10,10 @@ npm install
```
bash
npm run dev
```
3.
打包项目
```
bash
npm run build
```
## 主题
主题文件在
`src/theme`
中,你可以根据需要修改主题文件,然后重启项目即可生效。
...
...
src/components/markdown/markdownRender.vue
View file @
6f9fb590
...
...
@@ -40,17 +40,29 @@ md.use((md) => {
nextTick
(()
=>
{
const
chartDom
=
document
.
getElementById
(
chartId
);
if
(
chartDom
)
{
const
myChart
=
init
(
chartDom
);
const
option
=
JSON
.
parse
(
token
.
content
.
trim
());
// 调整 ECharts 图表的标题文字大小
if
(
option
.
title
&&
option
.
title
.
text
)
{
option
.
title
.
textStyle
=
{
fontSize
:
12
,
// 设置标题文字大小为 16px
};
try
{
const
myChart
=
init
(
chartDom
);
const
option
=
JSON
.
parse
(
token
.
content
.
trim
());
// 调整 ECharts 图表的标题文字大小
if
(
option
.
title
&&
option
.
title
.
text
)
{
option
.
title
.
textStyle
=
{
fontSize
:
14
,
// 设置标题文字大小为 16px
};
}
if
(
option
.
legend
)
{
option
.
legend
.
bottom
=
0
}
if
(
option
.
grid
)
{
option
.
grid
.
containLabel
=
true
}
else
{
option
.
grid
=
{
containLabel
:
true
}
}
myChart
.
setOption
(
option
);
}
catch
(
error
)
{
console
.
error
(
"Error rendering chart:"
,
error
);
}
myChart
.
setOption
(
option
);
}
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment