perf: run on nextTick only if necessary
This commit is contained in:
@@ -84,11 +84,20 @@ watch([content, mode], () => {
|
||||
|
||||
nextTick(() => {
|
||||
listenToClick()
|
||||
useImages(props.sha)
|
||||
generateTweets()
|
||||
mermaid.run({
|
||||
querySelector: `.note-${sha.value} .mermaid`,
|
||||
})
|
||||
|
||||
if (/\!\[.*?\]\(.*?\)/.test(rawContent.value)) {
|
||||
useImages(props.sha)
|
||||
}
|
||||
|
||||
if (rawContent.value.includes("@[tweet]")) {
|
||||
generateTweets()
|
||||
}
|
||||
|
||||
if (rawContent.value.includes("```mermaid")) {
|
||||
mermaid.run({
|
||||
querySelector: `.note-${sha.value} .mermaid`,
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user