From bd5b86272ca05925485f840223735998f655d678 Mon Sep 17 00:00:00 2001 From: Benny Guo Date: Wed, 16 Aug 2023 03:44:28 +0800 Subject: [PATCH] feat: add image enlarge feature --- package.json | 1 + pnpm-lock.yaml | 12 +++++++++++ src/App.vue | 22 ++++++++++++++++++- src/components/PageContent.vue | 3 +++ src/hooks/useLightBox.ts | 26 +++++++++++++++++++++++ src/shims-vue.d.ts | 6 ++++++ src/stores/lightbox.ts | 34 ++++++++++++++++++++++++++++++ src/styles/components/article.scss | 3 +++ src/views/Post.vue | 3 +++ 9 files changed, 109 insertions(+), 1 deletion(-) create mode 100644 src/hooks/useLightBox.ts create mode 100644 src/stores/lightbox.ts diff --git a/package.json b/package.json index e0ac253a..ce078238 100644 --- a/package.json +++ b/package.json @@ -72,6 +72,7 @@ "vite": "^4.3.9", "vite-plugin-html-transformer": "^4.0.0", "vite-plugin-svg-icons": "^2.0.1", + "vue-easy-lightbox": "^1.16.0", "vue-jest": "^3.0.7" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c1eab385..02232c0d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -127,6 +127,9 @@ devDependencies: vite-plugin-svg-icons: specifier: ^2.0.1 version: 2.0.1(vite@4.3.9) + vue-easy-lightbox: + specifier: ^1.16.0 + version: 1.16.0(vue@3.3.4) vue-jest: specifier: ^3.0.7 version: 3.0.7(babel-core@6.26.3)(vue-template-compiler@2.7.14)(vue@3.3.4) @@ -7983,6 +7986,15 @@ packages: vue: 3.3.4 dev: false + /vue-easy-lightbox@1.16.0(vue@3.3.4): + resolution: {integrity: sha512-9ckBIi56kTNkfbxioTBLKR3xnFjmkIs4SOvePn6XUciR+Dzuav0tgNjqDHkfsoo3nxIpUmfpQAT0YDl9TpJ5jA==} + engines: {node: '>=14.18.3'} + peerDependencies: + vue: ^3.0.0 + dependencies: + vue: 3.3.4 + dev: true + /vue-eslint-parser@9.3.1(eslint@8.0.0): resolution: {integrity: sha512-Clr85iD2XFZ3lJ52/ppmUDG/spxQu6+MAeHXjjyI4I1NUYZ9xmenQp4N0oaHJhrA8OOxltCVxMRfANGa70vU0g==} engines: {node: ^14.17.0 || >=16.0.0} diff --git a/src/App.vue b/src/App.vue index b80d01e7..8e44f624 100644 --- a/src/App.vue +++ b/src/App.vue @@ -32,6 +32,16 @@ {{ title }} + +