fix: fix issue #91
This commit is contained in:
@@ -66,7 +66,7 @@ async function init() {
|
||||
if (runtimeStore.editDict.articles.length) {
|
||||
selectArticle = runtimeStore.editDict.articles[0]
|
||||
}
|
||||
console.log('runtimeStore.editDict',runtimeStore.editDict)
|
||||
console.log('runtimeStore.editDict', runtimeStore.editDict)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -89,7 +89,7 @@ const {
|
||||
<BasePage>
|
||||
<div class="card mb-0 h-[95vh] flex flex-col" v-if="showBookDetail">
|
||||
<div class="flex justify-between items-center relative">
|
||||
<BackIcon class="z-2" @click="$router.back"/>
|
||||
<BackIcon class="z-2"/>
|
||||
<div class="absolute text-2xl text-align-center w-full">{{ runtimeStore.editDict.name }}</div>
|
||||
<div class="flex">
|
||||
<BaseButton :loading="studyLoading||loading" type="info" @click="isEdit = true">编辑</BaseButton>
|
||||
@@ -146,7 +146,7 @@ const {
|
||||
|
||||
<div class="card mb-0 h-[95vh]" v-else>
|
||||
<div class="flex justify-between items-center relative">
|
||||
<BackIcon class="z-2" @click="isAdd ? $router.back:(isEdit = false)"/>
|
||||
<BackIcon class="z-2" @click="isAdd ? $router.back():(isEdit = false)"/>
|
||||
<div class="absolute text-2xl text-align-center w-full">{{ runtimeStore.editDict.id ? '修改' : '创建' }}书籍
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,12 +1,23 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
import BaseIcon from "@/components/BaseIcon.vue";
|
||||
import {useAttrs} from "vue";
|
||||
import router from "@/router.ts";
|
||||
|
||||
const attrs = useAttrs()
|
||||
|
||||
function onClick() {
|
||||
if (!attrs.onClick) {
|
||||
router.back()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BaseIcon
|
||||
title="返回"
|
||||
@click="$router.back">
|
||||
@click="onClick"
|
||||
>
|
||||
<IconFormkitLeft/>
|
||||
</BaseIcon>
|
||||
</template>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import {DictId} from "@/types/types.ts";
|
||||
|
||||
import BasePage from "@/pages/pc/components/BasePage.vue";
|
||||
import {computed, onMounted, reactive, shallowReactive} from "vue";
|
||||
import {computed, onMounted, reactive, shallowReactive, watch} from "vue";
|
||||
import {useRuntimeStore} from "@/stores/runtime.ts";
|
||||
import {_getDictDataByUrl, _nextTick, cloneDeep, convertToWord, useNav} from "@/utils";
|
||||
import {nanoid} from "nanoid";
|
||||
@@ -214,6 +214,7 @@ function startPractice() {
|
||||
perDayStudyNumber: store.sdict.perDayStudyNumber,
|
||||
custom: store.sdict.custom,
|
||||
complete: store.sdict.complete,
|
||||
wordPracticeMode: settingStore.wordPracticeMode
|
||||
})
|
||||
let currentStudy = getCurrentStudyWord()
|
||||
nav('practice-words/' + store.sdict.id, {}, currentStudy)
|
||||
@@ -240,7 +241,7 @@ defineRender(() => {
|
||||
{
|
||||
showBookDetail.value ? <div className="card mb-0 h-[95vh] flex flex-col">
|
||||
<div class="flex justify-between items-center relative">
|
||||
<BackIcon class="z-2" onClick={router.back}/>
|
||||
<BackIcon class="z-2"/>
|
||||
<div class="absolute page-title text-align-center w-full">{runtimeStore.editDict.name}</div>
|
||||
<div class="flex">
|
||||
<BaseButton loading={studyLoading || loading} type="info"
|
||||
@@ -382,7 +383,13 @@ defineRender(() => {
|
||||
</div> :
|
||||
<div class="card mb-0 h-[95vh]">
|
||||
<div class="flex justify-between items-center relative">
|
||||
<BackIcon class="z-2" onClick={isAdd ? router.back : (isEdit = false)}/>
|
||||
<BackIcon class="z-2" onClick={() => {
|
||||
if (isAdd) {
|
||||
router.back()
|
||||
} else {
|
||||
isEdit = false
|
||||
}
|
||||
}}/>
|
||||
<div class="absolute page-title text-align-center w-full">
|
||||
{runtimeStore.editDict.id ? '修改' : '创建'}词典
|
||||
</div>
|
||||
|
||||
@@ -60,6 +60,7 @@ function startPractice() {
|
||||
perDayStudyNumber: store.sdict.perDayStudyNumber,
|
||||
custom: store.sdict.custom,
|
||||
complete: store.sdict.complete,
|
||||
wordPracticeMode: settingStore.wordPracticeMode
|
||||
})
|
||||
nav('practice-words/' + store.sdict.id, {}, currentStudy)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user