Skip to content

Commit db8159e

Browse files
committed
fix: 🐛 locale
1 parent 411f14e commit db8159e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.vitepress/theme/components/YiitapDemo.vue

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</template>
2424

2525
<script setup lang="ts">
26-
import { computed, ref, onMounted, onUnmounted } from 'vue';
26+
import { computed, ref, provide, onMounted, onUnmounted } from 'vue';
2727
import { useData } from 'vitepress';
2828
import { YiiEditor, ODocToc, OMainMenu } from '@yiitap/vue';
2929
import '@yiitap/vue/dist/vue.css';
@@ -38,8 +38,10 @@ const props = defineProps({
3838
3939
const { isDark } = useData();
4040
41+
const localeAlt = ref('en')
4142
const yiiEditor = ref<InstanceType<typeof YiiEditor>>()
4243
const tocRef = ref<InstanceType<typeof ODocToc>>()
44+
provide('locale', localeAlt)
4345
4446
const options = computed(() => {
4547
return {
@@ -101,6 +103,7 @@ const onScroll = (event: Event) => {
101103
};
102104
103105
onMounted(() => {
106+
localeAlt.value = props.locale
104107
window.addEventListener("scroll", onScroll);
105108
});
106109

0 commit comments

Comments
 (0)