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
a79026df
Commit
a79026df
authored
Apr 25, 2025
by
chenghong_tao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix echarts resize
parent
6be0b6e7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
markdownRender.vue
src/components/markdown/markdownRender.vue
+13
-1
No files found.
src/components/markdown/markdownRender.vue
View file @
a79026df
...
...
@@ -4,7 +4,7 @@
</
template
>
<
script
setup
>
import
{
computed
,
nextTick
}
from
"vue"
;
import
{
computed
,
nextTick
,
onUnmounted
}
from
"vue"
;
import
MarkdownIt
from
"markdown-it"
;
import
{
init
}
from
"echarts"
;
import
markdownItPrism
from
"markdown-it-prism"
;
...
...
@@ -60,6 +60,18 @@ md.use((md) => {
}
myChart
.
setOption
(
option
);
// 监听窗口大小变化事件
const
resizeHandler
=
()
=>
{
myChart
.
resize
();
};
window
.
addEventListener
(
"resize"
,
resizeHandler
);
// 清理事件监听器
onUnmounted
(()
=>
{
window
.
removeEventListener
(
"resize"
,
resizeHandler
);
});
}
catch
(
error
)
{
console
.
error
(
"Error rendering chart:"
,
error
);
}
...
...
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