Skip to content

Commit

Permalink
chore: replace version request (#1643)
Browse files Browse the repository at this point in the history
* chore: replace version request

* chore: replace version request
  • Loading branch information
liweijie0812 authored Nov 19, 2024
1 parent 535e486 commit 3ece456
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions site/web/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import { sortDocs } from './utils';
import { defineComponent } from 'vue';
import packageJson from '../../package.json';
const registryUrl = 'https://mirrors.tencent.com/npm/tdesign-mobile-vue';
const registryUrl =
'https://service-edbzjd6y-1257786608.hk.apigw.tencentcs.com/release/npm/versions/tdesign-mobile-vue';
const currentVersion = packageJson.version.replace(/\./g, '_');
const { docs, enDocs } = JSON.parse(JSON.stringify(siteConfig).replace(/component:.+/g, ''));
Expand All @@ -33,8 +34,8 @@ function watchHtmlMode(callback = () => {}) {
const observerCallback = (mutationsList) => {
for (const mutation of mutationsList) {
if (mutation.attributeName === "theme-mode") {
const themeMode = mutation.target.getAttribute("theme-mode") || 'light';
if (mutation.attributeName === 'theme-mode') {
const themeMode = mutation.target.getAttribute('theme-mode') || 'light';
if (themeMode) callback(themeMode);
}
}
Expand All @@ -46,7 +47,7 @@ function watchHtmlMode(callback = () => {}) {
return observer;
}
function changeIframeMode(mode){
function changeIframeMode(mode) {
const iframe = document.querySelector('iframe');
if (iframe?.contentWindow) {
iframe.contentWindow.document.documentElement.setAttribute('theme-mode', mode);
Expand Down Expand Up @@ -88,7 +89,7 @@ export default defineComponent({
};
this.initHistoryVersions();
watchHtmlMode(changeIframeMode)
watchHtmlMode(changeIframeMode);
},
watch: {
Expand Down

0 comments on commit 3ece456

Please sign in to comment.