Skip to content

Commit

Permalink
refactor(mock): 重构
Browse files Browse the repository at this point in the history
  • Loading branch information
ZvonimirSun committed Dec 27, 2023
1 parent 5088075 commit a453fb1
Show file tree
Hide file tree
Showing 13 changed files with 972 additions and 805 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"file-saver": "^2.0.5",
"highlight.js": "^11.9.0",
"js-beautify": "^1.14.11",
"json-editor-vue": "^0.11.2",
"leaflet": "^1.9.4",
"localforage": "^1.10.0",
"lodash-es": "^4.17.21",
Expand Down
56 changes: 56 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ declare module 'vue' {
ATypographyTitle: typeof import('ant-design-vue/es')['TypographyTitle']
Checkerboard: typeof import('./components/checkerboard.vue')['default']
Container: typeof import('./components/container.vue')['default']
CopyableText: typeof import('./components/copyable-text.vue')['default']
CopyableText: typeof import('./components/CopyableText.vue')['default']
Editor: typeof import('./components/editor/Editor.vue')['default']
EditorMini: typeof import('./components/editor/EditorMini.vue')['default']
ElAlert: typeof import('element-plus/es')['ElAlert']
Expand Down Expand Up @@ -77,6 +77,7 @@ declare module 'vue' {
ElUpload: typeof import('element-plus/es')['ElUpload']
FixedWidgets: typeof import('./components/fixed-widgets.vue')['default']
FormatTransformer: typeof import('./components/FormatTransformer.vue')['default']
JsonEditor: typeof import('./components/JsonEditor.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
VanillaJsonEditor: typeof import('./components/VanillaJsonEditor.vue')['default']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,7 @@
defineProps<{
val: string
}>()
async function copy (val: string) {
try {
await navigator.clipboard.writeText(val)
ElMessage.success('复制成功')
} catch (e) {
ElMessage.error('复制失败')
}
}
const { copy } = useCopy({ text: '复制成功' })
</script>
<style scoped lang="scss">
.copiable-text {
Expand Down
16 changes: 16 additions & 0 deletions src/components/JsonEditor.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<script setup>
import 'vanilla-jsoneditor/themes/jse-theme-dark.css'
import JsonEditorVue from 'json-editor-vue'
import { useStyleStore } from '@/stores/style'
const isDark = useStyleStore().isDark
</script>

<template>
<JsonEditorVue
v-bind="$attrs"
:class="{
'jse-theme-dark': isDark
}"
/>
</template>
2 changes: 0 additions & 2 deletions src/utils/hashHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ function getParam (key) {
const tmp = getParamList().find(item => item.key === key)
if (tmp) {
return tmp.value
} else {
return null
}
}

Expand Down
Loading

0 comments on commit a453fb1

Please sign in to comment.