refactor the code a wee bit
This commit is contained in:
parent
5d14ddbe41
commit
d78020a6bd
@ -12,12 +12,21 @@ import props from './props';
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
props,
|
props,
|
||||||
mounted: function() {
|
computed: {
|
||||||
let options = {};
|
options: function() {
|
||||||
|
let options = {};
|
||||||
|
|
||||||
Object.keys(props).filter( k => this[k] !== undefined ).forEach( k => options[k] = this[k] );
|
const is_defined = k => this[k] !== undefined;
|
||||||
console.log(options);
|
|
||||||
svg_pan_zoom( this.$slots.default[0].elm , options );
|
Object.keys(props)
|
||||||
|
.filter( is_defined )
|
||||||
|
.forEach( k => options[k] = this[k] );
|
||||||
|
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted: function() {
|
||||||
|
svg_pan_zoom( this.$slots.default[0].elm , this.options );
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user