diff --git a/src/stores/urlEncode.ts b/src/stores/urlEncode.ts new file mode 100644 index 000000000..8ec23be61 --- /dev/null +++ b/src/stores/urlEncode.ts @@ -0,0 +1,22 @@ +import { acceptHMRUpdate, defineStore } from 'pinia' + +export const useStore = defineStore('urlEncode', { + persist: true, + state: () => ({ + history: [] as Array> + }), + actions: { + addHistory ({ origin, target }: { origin: string, target: string }) { + if (origin && target) { + this.history.push([origin, target]) + } + }, + clearHistory () { + this.history = [] + } + } +}) + +if (import.meta.hot) { + import.meta.hot.accept(acceptHMRUpdate(useStore, import.meta.hot)) +} diff --git a/src/views/crypto/urlEncode.vue b/src/views/crypto/urlEncode.vue index 0f427f84a..e31a05111 100644 --- a/src/views/crypto/urlEncode.vue +++ b/src/views/crypto/urlEncode.vue @@ -42,20 +42,56 @@ placeholder="转换的内容粘贴在这里" :autosize="{ minRows: 5, maxRows: 8 }" /> + @@ -84,4 +126,10 @@ function clear () { } } } + +.history-list { + display: flex; + flex-direction: row; + flex-wrap: wrap; +}