Skip to content

Commit

Permalink
add options
Browse files Browse the repository at this point in the history
  • Loading branch information
rap2hpoutre committed May 1, 2018
1 parent cc40a76 commit 8c59aad
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 16 deletions.
1 change: 1 addition & 0 deletions dist/b257fa9c5ac8c515ac4d77a667ce2943.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/e34aafbb485a96eaf2a789b2bf3af6fe.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/e3f799c6dec9af194c86decdf7392405.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/vue-picture-swipe.js

Large diffs are not rendered by default.

29 changes: 15 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-picture-swipe",
"version": "0.1.7",
"version": "0.2.3",
"description": "A Vue integration PhotoSwipe image plugin",
"main": "src/main.js",
"scripts": {
Expand All @@ -23,23 +23,24 @@
"license": "MIT",
"dependencies": {
"photoswipe": "^4.1.2",
"vue": "^2.5.13"
"vue": "^2.5.16"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.3",
"babel-core": "^6.26.3",
"babel-loader": "^7.1.4",
"babel-preset-env": "^1.6.1",
"cross-env": "^5.1.3",
"css-loader": "^0.28.10",
"cross-env": "^5.1.4",
"css-loader": "^0.28.11",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-plugin-import": "^2.10.0",
"eslint-plugin-import": "^2.11.0",
"file-loader": "^1.1.11",
"node-sass": "^4.7.2",
"sass-loader": "^6.0.6",
"vue-loader": "^14.1.1",
"vue-template-compiler": "^2.5.13",
"webpack": "^4.0.1",
"webpack-cli": "^2.0.10",
"webpack-dev-server": "^3.1.0"
"node-sass": "^4.9.0",
"sass-loader": "^6.0.7",
"style-loader": "^0.21.0",
"vue-loader": "^14.2.2",
"vue-template-compiler": "^2.5.16",
"webpack": "^4.6.0",
"webpack-cli": "^2.1.2",
"webpack-dev-server": "^3.1.3"
}
}
7 changes: 6 additions & 1 deletion src/VuePictureSwipe.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,17 @@
}
],
type: Array
},
options: {
default: () => ({}),
type: Object
}
},
data() {
return {};
},
mounted() {
let that = this;
let initPhotoSwipeFromDOM = function (gallerySelector) {
// parse slide data (url, title, size ...) from DOM elements
Expand Down Expand Up @@ -266,7 +271,7 @@
}
// Pass data to PhotoSwipe and initialize it
gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, options);
gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, Object.assign(options, that.options));
gallery.init();
};
Expand Down
2 changes: 2 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ module.exports = {
{ test: /\.js$/, use: 'babel-loader' },
// use vue-loader for .vue files
{ test: /\.vue$/, use: 'vue-loader' },
{ test: /\.css$/, loader: 'style-loader!css-loader' },
{ test: /\.(gif|svg|jpg|png)$/, loader: 'file-loader' },
],
},
// default for pretty much every project
Expand Down

0 comments on commit 8c59aad

Please sign in to comment.