mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
docs(app): improve module and framework reactivity
This commit is contained in:
@@ -6,6 +6,10 @@ const value = ref<string | undefined>(undefined)
|
||||
onMounted(() => {
|
||||
value.value = framework.value
|
||||
})
|
||||
|
||||
watch(framework, () => {
|
||||
value.value = framework.value
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -9,6 +9,16 @@ const props = defineProps<{
|
||||
const config = useRuntimeConfig().public
|
||||
const { module } = useSharedData()
|
||||
|
||||
const value = ref<string | undefined>(module.value)
|
||||
|
||||
watch(module, () => {
|
||||
value.value = module.value
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
value.value = module.value
|
||||
})
|
||||
|
||||
const navigation = inject<Ref<ContentNavigationItem[]>>('navigation')
|
||||
|
||||
const items = computed(() => props.links.map(({ icon, ...link }) => link))
|
||||
@@ -52,11 +62,11 @@ const items = computed(() => props.links.map(({ icon, ...link }) => link))
|
||||
<UContentSearchButton />
|
||||
</UTooltip>
|
||||
|
||||
<UTooltip text="Open on GitHub" :kbds="['meta', 'G']" class="hidden lg:flex">
|
||||
<UTooltip text="Open on GitHub" class="hidden lg:flex">
|
||||
<UButton
|
||||
color="neutral"
|
||||
variant="ghost"
|
||||
:to="`https://github.com/nuxt/${module}`"
|
||||
:to="`https://github.com/nuxt/${value}`"
|
||||
target="_blank"
|
||||
icon="i-simple-icons-github"
|
||||
aria-label="GitHub"
|
||||
|
||||
@@ -6,6 +6,10 @@ const value = ref<string | undefined>(undefined)
|
||||
onMounted(() => {
|
||||
value.value = module.value
|
||||
})
|
||||
|
||||
watch(module, () => {
|
||||
value.value = module.value
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user