-
-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
hi, I'm fairly new to this world the following snippet will likely make you sick, but I'm trying to render (client-side) an xml file on an app using @nuxt/ui, unfortunately I haven't been able to change the theme following a toggle of useColorMode()
const colorMode = useColorMode();
const url = '/api/config.xml';
const xml = ref('');
const { data:content, pending, refresh, error } = await useAPI<string>(url, {
server: false,
headers: {
'Accept': 'application/xml',
}
});
watch(content, (value) => {
console.log(xml, value);
xml.value = (value !== null) ? value : '';
});
const theme = computed(() => colorMode.value === 'dark' ? 'vitesse-dark' : 'vitesse-light');
const prettyXML = await useHighlighted(xml, {
lang: 'xml',
theme,
});I'm even doubting the code itself is reactive on refresh.
any suggestion?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels