Skip to content
This repository has been archived by the owner on Aug 24, 2024. It is now read-only.

Commit

Permalink
feat: 移除记忆开关状态功能、修改搜索的触发条件为输入框失去焦点
Browse files Browse the repository at this point in the history
  • Loading branch information
adproqwq committed Apr 7, 2024
1 parent 1dc7145 commit 59f01d0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 39 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gkdtool-vue",
"version": "2.0.3",
"version": "2.1.0",
"private": true,
"type": "module",
"scripts": {
Expand Down
22 changes: 6 additions & 16 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { type InputHTMLAttributes, defineComponent } from 'vue'
import { search } from './methods/search'
import { getDefaultSub, getThirdPartySub, switchStatus } from './methods/sub'
import { getDefaultSub, getThirdPartySub } from './methods/sub'
import { output } from './methods/output'
import { changeSwitch } from './methods/changeSwitch'
import { quickStart } from './methods/quickStart'
Expand All @@ -11,7 +11,7 @@ import { edit } from './methods/edit'
export default defineComponent({
data() {
return {
codeVer: '2.0.3'
codeVer: '2.1.0'
}
},
methods: {
Expand All @@ -35,9 +35,6 @@ export default defineComponent({
},
edit(location: string) {
edit(location)
},
switchStatus(type: 'memorize' | 'read') {
switchStatus(type)
}
},
created() {
Expand All @@ -46,13 +43,14 @@ export default defineComponent({
mounted() {
;(window as any).changeSwitch = this.changeSwitch
;(window as any).edit = this.edit
;(window as any).output = this.output
}
})
</script>

<template>
<div>
<input id="name" placeholder="搜索应用或包名" @keydown.enter="search" />
<input id="name" placeholder="搜索应用或包名" @change="search" />
</div>
<div>
<button type="button" class="btn btn1" @click="output('all')">导出全部</button>
Expand All @@ -68,7 +66,7 @@ export default defineComponent({
<span>选择第三方订阅:</span>
<select id="thirdParty">
<option selected disabled hidden value="defult" label="默认订阅"></option>
<option value="Adpro" label="Adpro的GKD订阅"></option>
<option value="Adpro" label="AdproのGKD订阅"></option>
<option value="AIsouler" label="AIsouler的GKD订阅"></option>
<option value="aoguai" label="aoguai的GKD订阅"></option>
<option value="ganlinte" label="甘霖的GKD订阅"></option>
Expand All @@ -77,14 +75,6 @@ export default defineComponent({
</select>
<button type="button" class="btn btn1" @click="getThirdPartySub">快捷导入第三方订阅</button>
</div>
<div id="switchStatus">
<button type="button" class="btn btn1" @click="switchStatus('memorize')">
记忆当前订阅开关状态
</button>
<button type="button" class="btn btn1" @click="switchStatus('read')">
读取当前订阅开关状态
</button>
</div>
<div id="quickStart">
<button type="button" class="btn btn1" @click="quickStart">一键打开GKD</button>
</div>
Expand All @@ -110,7 +100,7 @@ export default defineComponent({
>默认订阅</a
>项目
</li>
<li>本网站由Adpro开发</li>
<li>©2024 Adpro</li>
</ul>
</div>
</div>
Expand Down
22 changes: 0 additions & 22 deletions src/methods/sub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,28 +57,6 @@ export const getThirdPartySub = () => {
}
}

export const switchStatus = (type: 'memorize' | 'read') => {
if (type == 'memorize') {
localStorage.setItem(String(fullScript.id), json5.stringify(script));
alert('全部都记下来了!');
}
else if (type == 'read') {
try {
let result = localStorage.getItem(String(fullScript.id));
throw result;
} catch (error) {
if (error == null) {
alert('我的脑子里似乎没有这方面的记忆');
return
}
}
originSub = { ...fullScript }
originSub.apps = json5.parse(localStorage.getItem(String(fullScript.id))!)
alert('一字不落地还原了!');
[fullScript, script, categories] = writeTable(originSub)
}
}

export let originSub: RawSubscription

export let fullScript: RawSubscription
Expand Down

0 comments on commit 59f01d0

Please sign in to comment.