Skip to content

Commit

Permalink
feat($medium-zoom): support selector option.
Browse files Browse the repository at this point in the history
  • Loading branch information
ulivz committed Nov 2, 2018
1 parent 41e4590 commit ce7da09
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions packages/@vuepress/plugin-medium-zoom/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const { path } = require('@vuepress/shared-utils')

module.exports = {
module.exports = (options, context) => ({
define: {
SELECTOR: options.selector || '.content img'
},
clientRootMixin: path.resolve(__dirname, 'mixin.js')
}
})
4 changes: 3 additions & 1 deletion packages/@vuepress/plugin-medium-zoom/mixin.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
/* global SELECTOR */

import './style.css'
import zoom from 'medium-zoom'

export default {
mounted () {
setTimeout(() => {
zoom('.content img')
zoom(SELECTOR)
}, 1000)
}
}

0 comments on commit ce7da09

Please sign in to comment.