fix(web/sourceeditor): update el-checkbox usage; fix reactivity bugs;update isbooksource regex
This commit is contained in:
@@ -56,7 +56,7 @@ const startDebug = async () => {
|
||||
};
|
||||
|
||||
const isBookSource = computed(() => {
|
||||
return /bookSource/.test(window.location.href);
|
||||
return /bookSource/i.test(window.location.href);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<el-checkbox
|
||||
size="large"
|
||||
border
|
||||
:label="sourceUrl"
|
||||
:value="sourceUrl"
|
||||
:class="{
|
||||
error: isSaveError,
|
||||
edit: sourceUrl == currentSourceUrl,
|
||||
|
||||
@@ -127,7 +127,7 @@ const importSourceFile = () => {
|
||||
input.click();
|
||||
};
|
||||
|
||||
const isBookSource = /bookSource/.test(window.location.href);
|
||||
const isBookSource = /bookSource/i.test(window.location.href);
|
||||
const outExport = () => {
|
||||
const exportFile = document.createElement("a");
|
||||
let sources =
|
||||
|
||||
@@ -60,7 +60,12 @@
|
||||
<script setup>
|
||||
const store = useSourceStore();
|
||||
defineProps(["config"]);
|
||||
const currentSource = store.currentSource;
|
||||
|
||||
const currentSource = computed(() => store.currentSource);
|
||||
/*
|
||||
修改currentSource的属性 没有直接修改本身
|
||||
const { currentSource } = storeToRefs(store);
|
||||
*/
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -19,7 +19,10 @@ import { useSourceStore } from "@/store";
|
||||
|
||||
const store = useSourceStore();
|
||||
|
||||
const current_tab = store.currentTab;
|
||||
const current_tab = computed({
|
||||
get:() => store.currentTab,
|
||||
set:(val) => store.currentTab = val
|
||||
});
|
||||
|
||||
const tabData = ref([
|
||||
["editTab", "编辑源"],
|
||||
|
||||
@@ -166,7 +166,7 @@ const redo = () => {
|
||||
};
|
||||
|
||||
const saveSource = () => {
|
||||
let isBookSource = /bookSource/.test(location.href),
|
||||
let isBookSource = /bookSource/i.test(location.href),
|
||||
/** @type {import("@/source.js").Source} */
|
||||
source = store.currentSource;
|
||||
if (isInvaildSource(source)) {
|
||||
|
||||
Reference in New Issue
Block a user