Feature(custom): update manual source URL based on language configuration

This commit is contained in:
Kuingsmile 2024-05-26 14:41:48 +08:00
parent 8b21e8407c
commit 3587bc5225

View File

@ -1,6 +1,6 @@
<template>
<webview
src="https://piclist.cn/app.html"
:src="srcUrl"
disablewebsecurity
allowpopups
autosize="on"
@ -9,6 +9,25 @@
/>
</template>
<script lang="ts" setup>
import { getConfig } from '@/utils/dataSender'
import { onMounted, ref } from 'vue'
import { II18nLanguage } from '~/universal/types/enum'
import { configPaths } from '~/universal/utils/configPaths'
const srcUrl = ref('https://piclist.cn/app.html')
const updateUrl = async () => {
const lang = await getConfig(configPaths.settings.language) || II18nLanguage.ZH_CN
srcUrl.value = lang === II18nLanguage.ZH_CN ? 'https://piclist.cn/app.html' : 'https://piclist.cn/en/app.html'
}
onMounted(() => {
updateUrl()
})
</script>
<script lang="ts">
export default {
name: 'DocumentPage'