added zoom and zoomBy call forward to svg-pan-zoom api
This commit is contained in:
parent
aba8972657
commit
843bc5abcd
@ -23,9 +23,11 @@ import { EventBus } from './EventBus';
|
||||
|
||||
import SvgPanZoomThumbnail from './SvgPanZoomThumbnail.vue';
|
||||
|
||||
import { SvgPanZoomApi } from './SvgPanZoomApi';
|
||||
|
||||
export default {
|
||||
props,
|
||||
components: { SvgPanZoomThumbnail },
|
||||
props,
|
||||
computed: {
|
||||
has_thumbnail: function() { return this.$slots.thumbnail },
|
||||
options: function() {
|
||||
@ -40,6 +42,10 @@ export default {
|
||||
return options;
|
||||
}
|
||||
},
|
||||
data: () => ({
|
||||
spz: null,
|
||||
bus: EventBus()
|
||||
}),
|
||||
mounted: function() {
|
||||
let options = {};
|
||||
|
||||
@ -59,7 +65,14 @@ export default {
|
||||
|
||||
this.$emit( 'svgpanzoom', this.spz );
|
||||
},
|
||||
data: () => ({ spz: null, bus: EventBus() }),
|
||||
methods: {
|
||||
zoom: function( v ){
|
||||
this.spz.zoom( v );
|
||||
},
|
||||
zoomBy: function( v ){
|
||||
this.spz.zoomBy( v );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
|
6
src/SvgPanZoomApi.js
Normal file
6
src/SvgPanZoomApi.js
Normal file
@ -0,0 +1,6 @@
|
||||
export const SvgPanZoomApi = ( SvgPanZoomInstance ) => ({
|
||||
zoom: function( v ){
|
||||
SvgPanZoomInstance.zoom( v );
|
||||
},
|
||||
zoomBy: ( v ) => SvgPanZoomInstance.zoomBy( v )
|
||||
});
|
Loading…
Reference in New Issue
Block a user