perf: run on nextTick only if necessary
This commit is contained in:
@@ -84,11 +84,20 @@ watch([content, mode], () => {
|
|||||||
|
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
listenToClick()
|
listenToClick()
|
||||||
|
|
||||||
|
if (/\!\[.*?\]\(.*?\)/.test(rawContent.value)) {
|
||||||
useImages(props.sha)
|
useImages(props.sha)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rawContent.value.includes("@[tweet]")) {
|
||||||
generateTweets()
|
generateTweets()
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rawContent.value.includes("```mermaid")) {
|
||||||
mermaid.run({
|
mermaid.run({
|
||||||
querySelector: `.note-${sha.value} .mermaid`,
|
querySelector: `.note-${sha.value} .mermaid`,
|
||||||
})
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -17,15 +17,6 @@ export const useNoteOverlay = (
|
|||||||
const displayNoteOverlay = computed(() => {
|
const displayNoteOverlay = computed(() => {
|
||||||
const valueIndex = toValue(index)
|
const valueIndex = toValue(index)
|
||||||
|
|
||||||
if (valueIndex === 1) {
|
|
||||||
console.log(
|
|
||||||
valueIndex,
|
|
||||||
x.value > valueIndex * NOTE_WIDTH,
|
|
||||||
x.value,
|
|
||||||
valueIndex * NOTE_WIDTH,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isMobile.value) {
|
if (isMobile.value) {
|
||||||
return y.value > valueIndex * noteHeight.value
|
return y.value > valueIndex * noteHeight.value
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -114,8 +114,6 @@ export const useUserRepoStore = defineStore("USER_REPO_STATE", {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("add file")
|
|
||||||
|
|
||||||
const savedRepoId = data.generateId(
|
const savedRepoId = data.generateId(
|
||||||
DataType.SavedRepo,
|
DataType.SavedRepo,
|
||||||
`${this.user}-${this.repo}`,
|
`${this.user}-${this.repo}`,
|
||||||
|
|||||||
Reference in New Issue
Block a user