vue-inline-svg
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -0,1 +1,4 @@ | ||
## 1.1.1 - 2019-03-18 | ||
- Fixed: don't use Vue's merge attrs logic | ||
## 1.1.0 - 2019-03-18 | ||
@@ -2,0 +5,0 @@ - Added: don't pass attrs with `false` value to `<svg>` |
@@ -25,3 +25,4 @@ (function (global, factory) { | ||
var InlineSvgComponent = { | ||
name: 'inline-svg', | ||
// name: 'inline-svg', | ||
inheritAttrs: false, | ||
render: function render(createElement) { | ||
@@ -28,0 +29,0 @@ if (!this.isLoaded) { |
@@ -1,1 +0,1 @@ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e=e||self).VueInlineSvg={})}(this,function(e){"use strict";var n={};var t={name:"inline-svg",render:function(e){return this.isLoaded?e("svg",{attrs:Object.assign(this.svgAttrs,(n=this.$vnode.data.attrs,Object.keys(n).reduce(function(e,t){return!1!==n[t]&&null!==n[t]&&void 0!==n[t]&&(e[t]=n[t]),e},{})))}):null;var n},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 t=this;n[e]||(this.isLoaded&&(this.isLoaded=!1,this.$emit("unloaded")),n[e]=this.download(e).catch(function(){delete n[e],t.$emit("error")})),n[e].then(function(e){t.svgAttrs={};for(var n=e.attributes,i=n.length-1;i>=0;i--)t.svgAttrs[n[i].name]=n[i].value;t.isLoaded=!0,t.$nextTick(function(){t.$el.innerHTML=e.innerHTML,t.$emit("loaded")})})},download:function(e){return new Promise(function(n,t){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];n(e)}else t()},i.onerror=t,i.send()})}}},i={install:function(e){e.component("inline-svg",t)}};e.default=t,e.InlineSvgComponent=t,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",{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.0", | ||
"version": "1.1.1", | ||
"description": "Replace SVG images with inline SVG element", | ||
@@ -5,0 +5,0 @@ "main": "dist/vue-inline-svg.js", |
@@ -19,3 +19,4 @@ /** @type Object{string: Promise<Element>} */ | ||
const InlineSvgComponent = { | ||
name: 'inline-svg', | ||
// name: 'inline-svg', | ||
inheritAttrs: false, | ||
render(createElement) { | ||
@@ -22,0 +23,0 @@ if (!this.isLoaded) { |
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
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
44147
368