diff --git a/README.md b/README.md
index c51a86f..b3d8836 100644
--- a/README.md
+++ b/README.md
@@ -19,10 +19,22 @@
> Vue.use(ProductZoomer)
# Usage
+
+### Basic:
+```
+
+```
+
+### Tracking click on preview image:
```
```
diff --git a/src/App.vue b/src/App.vue
index 887431a..8287a8b 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -5,6 +5,8 @@
@@ -218,6 +220,15 @@ export default {
},
components: {
ProductZoomer
+ },
+ methods: {
+ someCustomMethod (previewImage) {
+ // As parameter we get image that was clicked on
+ // Do, whatever you want, when user clicked on preview Image
+
+ alert('You clicked on image with id: ' + previewImage.id)
+ console.log(previewImage)
+ }
}
}
diff --git a/src/components/ProductZoomer.vue b/src/components/ProductZoomer.vue
index eb69846..245bc3f 100644
--- a/src/components/ProductZoomer.vue
+++ b/src/components/ProductZoomer.vue
@@ -1,10 +1,11 @@
-
@@ -14,14 +15,14 @@
-
@@ -53,6 +54,13 @@ export default {
default: function() {
return {};
}
+ },
+ clickEvent: {
+ type: String,
+ required: false,
+ default: function() {
+ return 'clickedOnImage'
+ }
}
},
data() {
@@ -84,7 +92,7 @@ export default {
return this.options.namespace + "-pane-container";
},
move_button: function() {
- return this.options.move_button_style === 'chevron' ?
+ return this.options.move_button_style === 'chevron' ?
{
"left": "chevron-left",
"right": "chevron-right"