vue-inline-svg
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -0,1 +1,4 @@ | ||
## 1.1.2 - 2019-08-22 | ||
- Fixed: now listeners correctly passes [#4](https://github.com/shrpne/vue-inline-svg/pull/4) | ||
## 1.1.1 - 2019-03-18 | ||
@@ -2,0 +5,0 @@ - Fixed: don't use Vue's merge attrs logic |
@@ -0,5 +1,6 @@ | ||
// eslint-disable-next-line import/extensions | ||
import InlineSvg from '../src/index.js'; | ||
new Vue({ | ||
el: "#app", | ||
el: '#app', | ||
components: { | ||
@@ -12,4 +13,9 @@ InlineSvg, | ||
currentSize: '150', | ||
} | ||
}; | ||
}, | ||
}); | ||
methods: { | ||
logClick() { | ||
console.log('click'); | ||
}, | ||
}, | ||
}); |
import InlineSvg from '../src/index.js'; | ||
new Vue({ | ||
el: "#app", | ||
el: '#app', | ||
components: { | ||
@@ -12,5 +12,10 @@ InlineSvg, | ||
currentSize: '150', | ||
} | ||
}; | ||
}, | ||
render: function (createElement) { | ||
methods: { | ||
logClick() { | ||
console.log('click'); | ||
}, | ||
}, | ||
render(createElement) { | ||
let self = this; | ||
@@ -24,3 +29,6 @@ return createElement('div', [ | ||
height: 150, | ||
} | ||
}, | ||
on: { | ||
click: this.logClick, | ||
}, | ||
}), | ||
@@ -32,3 +40,3 @@ createElement(InlineSvg, { | ||
height: self.currentSize, | ||
} | ||
}, | ||
}), | ||
@@ -63,11 +71,9 @@ ]), | ||
self[dataName] = event.target.value; | ||
} | ||
} | ||
}, | ||
}, | ||
}), | ||
value.toString(), | ||
]) | ||
]); | ||
} | ||
} | ||
}, | ||
}); | ||
@@ -33,2 +33,3 @@ (function (global, factory) { | ||
return createElement('svg', { | ||
on: this.$listeners, | ||
attrs: Object.assign(this.svgAttrs, filterAttrs(this.$vnode.data.attrs)) | ||
@@ -35,0 +36,0 @@ }); |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).VueInlineSvg={})}(this,function(e){"use strict";var t={};var n={inheritAttrs:!1,render:function(e){return this.isLoaded?e("svg",{attrs:Object.assign(this.svgAttrs,(t=this.$vnode.data.attrs,Object.keys(t).reduce(function(e,n){return!1!==t[n]&&null!==t[n]&&void 0!==t[n]&&(e[n]=t[n]),e},{})))}):null;var t},props:{src:{type:String,required:!0}},data:function(){return{isLoaded:!1,svgAttrs:{}}},mounted:function(){this.inline(this.src)},watch:{src:function(e){this.inline(e)}},methods:{inline:function(e){var n=this;t[e]||(this.isLoaded&&(this.isLoaded=!1,this.$emit("unloaded")),t[e]=this.download(e).catch(function(){delete t[e],n.$emit("error")})),t[e].then(function(e){n.svgAttrs={};for(var t=e.attributes,i=t.length-1;i>=0;i--)n.svgAttrs[t[i].name]=t[i].value;n.isLoaded=!0,n.$nextTick(function(){n.$el.innerHTML=e.innerHTML,n.$emit("loaded")})})},download:function(e){return new Promise(function(t,n){var i=new XMLHttpRequest;i.open("GET",e,!0),i.onload=function(){if(i.status>=200&&i.status<400){var e=(new DOMParser).parseFromString(i.responseText,"text/xml").getElementsByTagName("svg")[0];t(e)}else n()},i.onerror=n,i.send()})}}},i={install:function(e){e.component("inline-svg",n)}};e.default=n,e.InlineSvgComponent=n,e.InlineSvgPlugin=i,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).VueInlineSvg={})}(this,function(e){"use strict";var t={};var n={inheritAttrs:!1,render:function(e){return this.isLoaded?e("svg",{on:this.$listeners,attrs:Object.assign(this.svgAttrs,(t=this.$vnode.data.attrs,Object.keys(t).reduce(function(e,n){return!1!==t[n]&&null!==t[n]&&void 0!==t[n]&&(e[n]=t[n]),e},{})))}):null;var t},props:{src:{type:String,required:!0}},data:function(){return{isLoaded:!1,svgAttrs:{}}},mounted:function(){this.inline(this.src)},watch:{src:function(e){this.inline(e)}},methods:{inline:function(e){var n=this;t[e]||(this.isLoaded&&(this.isLoaded=!1,this.$emit("unloaded")),t[e]=this.download(e).catch(function(){delete t[e],n.$emit("error")})),t[e].then(function(e){n.svgAttrs={};for(var t=e.attributes,i=t.length-1;i>=0;i--)n.svgAttrs[t[i].name]=t[i].value;n.isLoaded=!0,n.$nextTick(function(){n.$el.innerHTML=e.innerHTML,n.$emit("loaded")})})},download:function(e){return new Promise(function(t,n){var i=new XMLHttpRequest;i.open("GET",e,!0),i.onload=function(){if(i.status>=200&&i.status<400){var e=(new DOMParser).parseFromString(i.responseText,"text/xml").getElementsByTagName("svg")[0];t(e)}else n()},i.onerror=n,i.send()})}}},i={install:function(e){e.component("inline-svg",n)}};e.default=n,e.InlineSvgComponent=n,e.InlineSvgPlugin=i,Object.defineProperty(e,"__esModule",{value:!0})}); |
{ | ||
"name": "vue-inline-svg", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Replace SVG images with inline SVG element", | ||
@@ -29,3 +29,3 @@ "main": "dist/vue-inline-svg.js", | ||
"license": "MIT", | ||
"repository": "shrpne/vue-inline-svg", | ||
"repository": "https://github.com/shrpne/vue-inline-svg", | ||
"bugs": { | ||
@@ -32,0 +32,0 @@ "url": "https://github.com/shrpne/vue-inline-svg/issues" |
@@ -28,2 +28,3 @@ /** @type Object{string: Promise<Element>} */ | ||
{ | ||
on: this.$listeners, | ||
attrs: Object.assign(this.svgAttrs, filterAttrs(this.$vnode.data.attrs)), | ||
@@ -30,0 +31,0 @@ }, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
44701
385