feat: 接收到webaddress时自动展开
This commit is contained in:
@@ -129,6 +129,16 @@
|
||||
}
|
||||
)
|
||||
|
||||
watch(
|
||||
() => props.type,
|
||||
(val) => {
|
||||
if (val === 'sketch') {
|
||||
fetchedUrlSet.value = new Set()
|
||||
urlList.value = []
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
watch(
|
||||
() => props.sketchList,
|
||||
() => {
|
||||
@@ -199,13 +209,16 @@
|
||||
}
|
||||
|
||||
const urlLoading = ref(false)
|
||||
const fetchedUrlSet = ref<Set<string>>(new Set())
|
||||
const setUrls = async (list: string[]) => {
|
||||
reportType.value = 'urls'
|
||||
urlList.value = []
|
||||
const newUrls = [...new Set(list.filter((url) => !fetchedUrlSet.value.has(url)))]
|
||||
if (newUrls.length === 0) return
|
||||
urlLoading.value = true
|
||||
const res = await fetchUrlTitle(list)
|
||||
const res = await fetchUrlTitle(newUrls)
|
||||
urlLoading.value = false
|
||||
urlList.value = res
|
||||
newUrls.forEach((url) => fetchedUrlSet.value.add(url))
|
||||
urlList.value = [...urlList.value, ...res]
|
||||
}
|
||||
// watch(
|
||||
// () => sessionId.value,
|
||||
|
||||
Reference in New Issue
Block a user