Skip to content

Commit

Permalink
feat: 1.0.0alpha版本
Browse files Browse the repository at this point in the history
  • Loading branch information
simply-none committed Jan 17, 2024
1 parent e54409c commit 29f9f88
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 24 deletions.
5 changes: 5 additions & 0 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ export const routes = [
name: 'lookTodayVoca',
component: () => import('../views/todayVocabularyList.vue')
},
{
path: '/words-iframe',
name: 'wordsIframe',
component: () => import('../views/wordsIframe.vue')
},
{
path: '/',
name: 'wordMainPage',
Expand Down
24 changes: 2 additions & 22 deletions src/views/todayVocabulary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@
import TablePage from "../components/tablePage.vue";
import { ref, reactive, onMounted, watch, toRaw } from "vue";
import {
TableV2SortOrder,
TableV2FixedDir,
ElButton,
ElIcon,
} from "element-plus";
Expand All @@ -81,12 +79,6 @@ import moment from "moment";
import { funDownloadByJson } from "../utils/generateFile";
import { delBFromA, filterBFromA } from "../utils/common";

const sortState = ref({
n: TableV2SortOrder.ASC,
date: TableV2SortOrder.ASC,
count: TableV2SortOrder.ASC,
});

let todayDate = ref(moment().format("YYYY-MM-DD"));

let useBook = useBookStore();
Expand Down Expand Up @@ -158,18 +150,6 @@ function getPageData(data, current, newSize) {
return data.slice(start, start + tablePageSize.value);
}

function onSort({ key, order }) {
sortState.value[key] = order;
historyVocalist.value.sort((a, b) => {
if (a[key] > b[key]) {
return 1;
}
return -1;
});
historyVocalist.value =
order === "asc" ? historyVocalist.value : historyVocalist.value.reverse();
}

async function delWrod(data, index) {
historyTable
.where("id")
Expand Down Expand Up @@ -243,7 +223,7 @@ async function getVocaList() {
}
todayTable.toArray().then((d) => {
vocalist.value = d;
vocalistPage.value = d;
vocalistPage.value = getPageData(vocalist.value, 1)
});
}

Expand All @@ -257,7 +237,7 @@ async function getHistoryVocaList() {
}
historyTable.toArray().then((d) => {
historyVocalist.value = d;
historyVocalistPage.value = d;
historyVocalistPage.value = getPageData(historyVocalist.value, 1)
});
}
</script>
Expand Down
4 changes: 2 additions & 2 deletions src/views/wordMainPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ import {
onUnmounted,
toRaw,
} from "vue";
import { ElNotification, ElMessage, ElLoading } from "element-plus";
import { Setting, RefreshLeft } from "@element-plus/icons-vue";
import { useVoca } from "../hooks/useVoca";
import SettingCom from "./Setting.vue";
import WordCom from "./word.vue";
import ConciseWord from "./conciseWord.vue";
import { ElNotification, ElMessage, ElLoading } from "element-plus";
import { Setting, RefreshLeft } from "@element-plus/icons-vue";
import { useBookStore } from "../stores/books";
import { storeToRefs } from "pinia";
Expand Down
28 changes: 28 additions & 0 deletions src/views/wordsIframe.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<template>
<iframe width="100%" height="100%" style="border: 0;" :src="wordOriginLink + encodeURI(word)" ref="iframeRef"></iframe>
<hr />
</template>

<script setup>
import { nextTick, onMounted, ref } from "vue";
import { storeToRefs } from "pinia";
import { useWordOriginStore } from "../stores/wordOrigin";
let props = defineProps({
word: {
type: String,
default: () => 'upgrade'
}
})
let iframeRef = ref();
let useWordOrigin = useWordOriginStore();
let { wordOriginLink, wordOriginList } = storeToRefs(useWordOrigin);
let { updateWordOriginLink } = useWordOrigin;
nextTick(() => {
console.log(iframeRef, "ref");
});
</script>

<style lang="scss" scoped></style>

0 comments on commit 29f9f88

Please sign in to comment.