mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-20 09:44:26 +08:00
code refactor
This commit is contained in:
@@ -1970,17 +1970,19 @@ export function useI18n() {
|
|||||||
services.setLocale(languageKey);
|
services.setLocale(languageKey);
|
||||||
document.querySelector('html')?.setAttribute('lang', languageKey);
|
document.querySelector('html')?.setAttribute('lang', languageKey);
|
||||||
|
|
||||||
if (document.querySelector('html')?.getAttribute('data-dir-mode') === 'isolate') {
|
if (document.querySelector('html')?.getAttribute('data-dir-mode') === 'static') {
|
||||||
if (languageInfo && languageInfo.textDirection === TextDirection.LTR) {
|
if (languageInfo && languageInfo.textDirection === TextDirection.LTR) {
|
||||||
if (location.search.includes('rtl')) {
|
if (location.search.includes('rtl')) {
|
||||||
const url = new URL(window.location.href);
|
const url = new URL(window.location.href);
|
||||||
url.search = '';
|
url.search = '';
|
||||||
|
url.hash = '#/';
|
||||||
window.location.replace(url.toString());
|
window.location.replace(url.toString());
|
||||||
}
|
}
|
||||||
} else if (languageInfo && languageInfo.textDirection === TextDirection.RTL) {
|
} else if (languageInfo && languageInfo.textDirection === TextDirection.RTL) {
|
||||||
if (!location.search.includes('rtl')) {
|
if (!location.search.includes('rtl')) {
|
||||||
const url = new URL(window.location.href);
|
const url = new URL(window.location.href);
|
||||||
url.searchParams.set('rtl', '');
|
url.searchParams.set('rtl', '');
|
||||||
|
url.hash = '#/';
|
||||||
window.location.replace(url.toString());
|
window.location.replace(url.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-3
@@ -1,5 +1,5 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html data-dir-mode="static">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
|
||||||
@@ -60,8 +60,6 @@
|
|||||||
<link rel="manifest" href="manifest.json">
|
<link rel="manifest" href="manifest.json">
|
||||||
<link id="framework7-css" rel="stylesheet" crossorigin>
|
<link id="framework7-css" rel="stylesheet" crossorigin>
|
||||||
<script>
|
<script>
|
||||||
document.querySelector('html').setAttribute('data-dir-mode', 'isolate');
|
|
||||||
|
|
||||||
if (location.search.includes('rtl')) {
|
if (location.search.includes('rtl')) {
|
||||||
document.querySelector('html').setAttribute('dir', 'rtl');
|
document.querySelector('html').setAttribute('dir', 'rtl');
|
||||||
document.getElementById('framework7-css').href = '{{framework7-rtl-css-filepath}}';
|
document.getElementById('framework7-css').href = '{{framework7-rtl-css-filepath}}';
|
||||||
|
|||||||
Reference in New Issue
Block a user