mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-05-11 18:10:32 +08:00
✨ Feature(custom): update manual source URL based on language configuration
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user