diff --git a/src/app.vue b/src/app.vue
index 592da0c..5768984 100644
--- a/src/app.vue
+++ b/src/app.vue
@@ -1,5 +1,5 @@
-
+
@@ -13,6 +13,7 @@ export default {
mounted() {
var user = localStorage.getItem('user')
+
if (user) {
this.$store.user = JSON.parse(user)
}
diff --git a/src/components/header.vue b/src/components/header.vue
index 0c54b08..5d4018a 100644
--- a/src/components/header.vue
+++ b/src/components/header.vue
@@ -23,13 +23,58 @@
同时我们也提供自主提交开源库的收录(前提是在npm上发布的)
-
+
diff --git a/src/main.js b/src/main.js
index cb5888c..7c68002 100644
--- a/src/main.js
+++ b/src/main.js
@@ -2,6 +2,7 @@ import { createApp } from 'vue'
import '//jscdn.ink/es.shim/2.1.0/index.js'
import '//jscdn.ink/@bytedo/wcui/1.0.12/form/input.js'
+import '//jscdn.ink/@bytedo/wcui/1.0.12/form/dropdown.js'
import '//jscdn.ink/@bytedo/wcui/1.0.12/form/button.js'
import '//jscdn.ink/@bytedo/wcui/1.0.12/form/link.js'
import '//jscdn.ink/@bytedo/wcui/1.0.12/layer/index.js'
diff --git a/src/store.js b/src/store.js
index 9b79883..4a97cfa 100644
--- a/src/store.js
+++ b/src/store.js
@@ -7,7 +7,8 @@ const store = reactive({
1: '🕒待审核中',
2: '✅正常',
9: '🙅🏻拒绝收录'
- }
+ },
+ result: null // 搜索结果
})
export default function (app) {
diff --git a/src/views/home.vue b/src/views/home.vue
index c212c09..9b682cc 100644
--- a/src/views/home.vue
+++ b/src/views/home.vue
@@ -1,6 +1,24 @@
-
-
+
+
+ -
+ {{ $store.result.id }} -
+
+
+
+
+ -
+
+ //jscdn.ink/{{ $store.result.id }}/{{ f }}
+
+
+
+
- {{ it.name }} - v{{ it.version }}
-
@@ -34,34 +52,40 @@ export default {
'vue.runtime.global.prod.js'
]
},
- {
- name: 'vue-router',
- version: '4.1.6',
- files: [
- 'vue-router.cjs',
- 'vue-router.cjs.js',
- 'vue-router.cjs.prod.js',
- 'vue-router.esm-browser.js',
- 'vue-router.esm-bundler.js',
- 'vue-router.global.js',
- 'vue-router.global.prod.js',
- 'vue-router.mjs',
- 'vue-router.node.mjs',
- 'vue-router.prod.cjs'
- ]
- },
{
name: '@bytedo/fetch',
version: '2.1.1',
files: ['index.js', 'next.js']
}
- ]
+ ],
+ version: ''
+ }
+ },
+
+ watch: {
+ '$store.result'(val) {
+ if (val) {
+ this.version = val.versions[val.versions.length - 1]
+ } else {
+ this.version = ''
+ }
}
},
mounted() {
this.$store.searchShow = true
- console.log(this.$route.query)
+ if (this.$route.query.name) {
+ this.$store.searchInput = this.$route.query.name
+ }
+ },
+
+ methods: {
+ copy(ev) {
+ if (ev.target.tagName === 'SECTION') {
+ navigator.clipboard.writeText(ev.target.textContent.trim())
+ layer.toast('复制成功', 'success')
+ }
+ }
}
}
@@ -71,7 +95,7 @@ export default {
display: flex;
flex-direction: column;
align-items: center;
- padding-top: 16px;
+ padding: 16px 0 32px;
.card {
width: 1024px;
diff --git a/src/views/request.vue b/src/views/request.vue
index b243dd5..088a4b4 100644
--- a/src/views/request.vue
+++ b/src/views/request.vue
@@ -25,7 +25,8 @@
{{ it.remark || '-' }}
更新通过
拒绝
删除