File tree 4 files changed +28
-4
lines changed
@vuepress/plugin-medium-zoom
docs/docs/plugin/official
4 files changed +28
-4
lines changed Original file line number Diff line number Diff line change 1
- /* global SELECTOR */
1
+ /* global SELECTOR, OPTIONS */
2
2
3
3
import './style.css'
4
4
import zoom from 'medium-zoom'
@@ -20,7 +20,7 @@ export default {
20
20
if ( this . zoom ) {
21
21
this . zoom . detach ( )
22
22
}
23
- this . zoom = zoom ( SELECTOR )
23
+ this . zoom = zoom ( SELECTOR , OPTIONS )
24
24
} , 1000 )
25
25
}
26
26
}
Original file line number Diff line number Diff line change @@ -2,7 +2,8 @@ const { path } = require('@vuepress/shared-utils')
2
2
3
3
module . exports = ( options , context ) => ( {
4
4
define : {
5
- SELECTOR : options . selector || '.content img'
5
+ SELECTOR : options . selector || '.content img' ,
6
+ OPTIONS : options . options
6
7
} ,
7
8
clientRootMixin : path . resolve ( __dirname , 'clientRootMixin.js' )
8
9
} )
Original file line number Diff line number Diff line change 18
18
" generator"
19
19
],
20
20
"dependencies" : {
21
- "medium-zoom" : " ^0.4.0 "
21
+ "medium-zoom" : " ^1. 0.4"
22
22
},
23
23
"author" :
" ULIVZ <[email protected] >" ,
24
24
"license" : " MIT" ,
Original file line number Diff line number Diff line change @@ -16,15 +16,38 @@ yarn add -D @vuepress/plugin-medium-zoom@next
16
16
17
17
## Usage
18
18
19
+ ** Simple** :
20
+
19
21
``` javascript
20
22
module .exports = {
21
23
plugins: [' @vuepress/medium-zoom' ]
22
24
}
23
25
```
24
26
27
+ ** With options** :
28
+
29
+ ``` javascript
30
+ module .exports = {
31
+ plugins: {
32
+ ' @vuepress/medium-zoom' : {
33
+ selector: ' img.zoom-custom-imgs' ,
34
+
35
+ // medium-zoom options here (https://github.com/francoischalifour/medium-zoom#options)
36
+ options: {
37
+ margin: 16
38
+ }
39
+ }
40
+ }
41
+ }
42
+ ```
43
+
25
44
## Options
26
45
27
46
### selector
28
47
29
48
- Type: ` string `
30
49
- Default: ` .content img `
50
+
51
+ ### options
52
+
53
+ Other ` medium-zoom ` options. [ See documentation] ( https://github.com/francoischalifour/medium-zoom#options ) .
You can’t perform that action at this time.
0 commit comments