Skip to content

Commit 7555c62

Browse files
committed
feat: support vue 3
1 parent 87266ce commit 7555c62

File tree

6 files changed

+167
-411
lines changed

6 files changed

+167
-411
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ dist/
1111
*.njsproj
1212
*.sln
1313
.history
14+
.vscode

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
registry=https://registry.npmjs.org/

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# vue-photo-zoom-pro
22

3-
> Vue picture magnifier
3+
> Vue picture magnifier(Vue 2 & Vue 3)
44
55
![example](https://raw.githubusercontent.com/Mater1996/vue-photo-zoom-pro/master/example.png)
66

@@ -9,8 +9,14 @@
99
```js
1010
npm install vue-photo-zoom-pro
1111

12+
# In Vue 2 project
13+
npm i vue-photo-zoom-pro@2.x
14+
1215
# or
1316
yarn add vue-photo-zoom-pro
17+
18+
# In Vue 2 project
19+
yarn add vue-photo-zoom-pro@2.x
1420
```
1521
## Usage
1622

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"core-js": "^3.0.0"
3636
},
3737
"peerDependencies": {
38-
"vue": "^2.5.11"
38+
"vue": "^3.0.0"
3939
},
4040
"devDependencies": {
4141
"@babel/core": "^7.15.0",
@@ -73,9 +73,9 @@
7373
"rollup-plugin-peer-deps-external": "^2.2.4",
7474
"rollup-plugin-postcss": "^4.0.0",
7575
"rollup-plugin-terser": "^7.0.2",
76-
"rollup-plugin-vue": "^5.0.0",
76+
"rollup-plugin-vue": "^6.0.0",
7777
"serve": "^12.0.0",
78-
"vue-template-compiler": "^2.6.14",
78+
"vue": "^3.2.45",
7979
"vuepress": "^1.9.7"
8080
},
8181
"keywords": [

rollup.config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
const path = require('path')
22
const peerDepsExternal = require('rollup-plugin-peer-deps-external')
33
const { nodeResolve } = require('@rollup/plugin-node-resolve')
4-
const commonjs = require('@rollup/plugin-commonjs')
54
const vue = require('rollup-plugin-vue')
65
const babel = require('rollup-plugin-babel')
76
const postcss = require('rollup-plugin-postcss')
@@ -58,7 +57,6 @@ module.exports = ({ environment }) => {
5857
preventAssignment: true,
5958
values: { 'process.env.NODE_ENV': JSON.stringify(NODE_ENV) }
6059
}),
61-
commonjs(),
6260
vue({
6361
css: !isProd,
6462
normalizer: '~vue-runtime-helpers/dist/normalize-component.js'
@@ -67,7 +65,7 @@ module.exports = ({ environment }) => {
6765
browser: true,
6866
preferBuiltins: true
6967
}),
70-
babel({
68+
isIIFE && babel({
7169
babelrc: true,
7270
runtimeHelpers: true,
7371
extensions: ['.js', '.jsx', '.es6', '.es', '.mjs', '.vue']

0 commit comments

Comments
 (0)