Skip to content

Commit

Permalink
chore: 组件化重构
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Dec 8, 2022
1 parent 558950c commit 6ab2504
Show file tree
Hide file tree
Showing 28 changed files with 403 additions and 1,172 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@typescript-eslint/no-var-requires": 1,
"no-undef": 0,
"no-undef-init": 1,
"no-undefined": 1,
"no-undefined": 0,
"no-prototype-builtins": 1,
"no-unused-expressions": 1
}
Expand Down
6 changes: 3 additions & 3 deletions components/detail/PostDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import { onMounted, ref } from "vue"
import { getPageId, getWidgetId } from "~/utils/platform/siyuan/siyuanUtil"
import { goToPage } from "~/utils/otherlib/ChromeUtil"
import { appandStr } from "~/utils/strUtil"
import { appendStr } from "~/utils/strUtil"
import PostDetailService from "~/components/detail/PostDetailService.vue"
import { LogFactory } from "~/utils/logUtil"
Expand All @@ -58,9 +58,9 @@ const pid = ref("")
const handlePublish = async () => {
const widgetResult = getWidgetId()
if (widgetResult.isInSiyuan) {
goToPage(appandStr("/index.html?id=", pid.value))
goToPage(appendStr("/index.html?id=", pid.value))
} else {
goToPage(appandStr("/publish/index.html?id=", pid.value))
goToPage(appendStr("/publish/index.html?id=", pid.value))
}
}
Expand Down
12 changes: 0 additions & 12 deletions components/publish/tab/ChangeLocale.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,13 @@
/>
</el-select>
</el-form-item>

<el-form-item :label="$t('theme.mode.choose')">
<!-- 暗黑模式 -->
<el-button type="primary" @click="toggleDark()">
{{ isDark ? $t("theme.mode.light") : $t("theme.mode.dark") }}
</el-button>
</el-form-item>
</el-form>
</div>
</template>

<script lang="ts" setup>
import { useI18n } from "vue-i18n"
import { onMounted } from "vue"
import { useDark, useToggle } from "@vueuse/core"
import { LogFactory } from "~/utils/logUtil"
const logger = LogFactory.getLogger("components/publish/tab/ChangeLocale.vue")
Expand All @@ -72,11 +64,7 @@ const langs = [
},
]
const isDark = useDark()
const toggleDark = useToggle(isDark)
const langChanged = (lang) => {
logger.debug("langChanged=>", lang)
localStorage.Lang = lang
locale.value = lang
}
Expand Down
7 changes: 5 additions & 2 deletions components/publish/tab/PlatformMain.vue
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ const initConf = () => {
const dynamicJsonCfg = getDynamicJsonCfg()
formData.dynamicConfigArray = initDynCfg(dynamicJsonCfg.totalCfg || [])
formData.githubArray = initDynCfg(dynamicJsonCfg.githubCfg || [])
formData.metaweblogArray = initDynCfg(dynamicJsonCfg.metaweblogCfg || [])
formData.wordpressArray = initDynCfg(dynamicJsonCfg.wordpressCfg || [])
logger.debug("dynamicJsonCfg=>", JSON.stringify(dynamicJsonCfg))
Expand All @@ -193,10 +194,12 @@ const props = defineProps({
},
})
/* 监听props */
/**
* 监听props
*/
watch(
() => props.isReload,
/**/ (oldValue, newValue) => {
(oldValue, newValue) => {
initConf()
}
)
Expand Down
1 change: 0 additions & 1 deletion components/publish/tab/ServiceSwitch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ const kmsOnChange = (val) => {
initConf()
}
const dynamicOnChange = (val) => {
logger.warn("dynamicOnChange,val=>", val)
const switchItem = getSwitchItem(val)
setBooleanConf(switchItem.switchKey, switchItem.switchValue)
initConf()
Expand Down

0 comments on commit 6ab2504

Please sign in to comment.