More embeddable widgets

This commit is contained in:
2024-08-17 10:51:24 +08:00
parent 48690b1b88
commit 8e28781cbc
5 changed files with 244 additions and 11 deletions

View File

@@ -37,8 +37,6 @@ const { t } = useI18n()
const route = useRoute()
const config = useRuntimeConfig()
const posts = ref<any[]>([])
const { data: account } = await useFetch<any>(`${config.public.solarNetworkApi}/cgi/auth/users/${route.params.name}`)
if (account.value == null) {
@@ -52,15 +50,6 @@ const urlOfAvatar = computed(() => account.value?.avatar ? `${config.public.sola
const urlOfBanner = computed(() => account.value?.banner ? `${config.public.solarNetworkApi}/cgi/files/attachments/${account.value.banner}` : void 0)
const externalOpenLink = computed(() => `${config.public.solianUrl}/accounts/view/${route.params.name}`)
async function loadPost({ done }: any) {
const res = await fetch(`${config.public.solarNetworkApi}/cgi/interactive/posts?take=10&author=${route.params.name}&offset=${posts.value.length}`)
const result = await res.json()
posts.value.push(...result.data)
done("ok")
}
</script>
<style scoped>