Skip to content

Commit

Permalink
fix(playground): fix language change
Browse files Browse the repository at this point in the history
  • Loading branch information
a145789 committed Mar 7, 2023
1 parent b716e8b commit f6d48da
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion playground/src/components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const iconClass = 'text-#555 dark:text-#fff'
</script>

<template>
<var-paper :elevation="2" :height="50" class="px-25px">
<var-paper :elevation="2" :height="50" class="px-30px">
<var-row align="center" justify="space-between" class="h-full">
<var-col :span="12" :xs="20">
<div class="font-500 text-20px" :class="TEXT_COLOR">Vue3 script to script-setup</div>
Expand Down
7 changes: 7 additions & 0 deletions playground/src/components/Monaco.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ function setValue(value: string) {
editor.value?.setValue(value)
}
watch([() => props.language, editor], ([language, editor]) => {
if (!editor?.getModel()) {
return
}
monaco.editor.setModelLanguage(editor.getModel()!, language);
})
onUnmounted(() => {
editor.value?.dispose();
});
Expand Down

0 comments on commit f6d48da

Please sign in to comment.