Files
red-valley/resources/[framework]/[base]/[jobs]/mBossmenu/html/util/inlineSvg.js
2026-03-29 21:41:17 +03:00

33 lines
653 B
JavaScript

export default {
props: {
src: {
type: String,
required: true
},
fill: {
type: String,
default: 'currentColor'
},
theme : {
type : String,
}
},
data() {
return {
svg: ''
}
},
async mounted() {
const res = await fetch(this.src);
const html = await res.text();
this.svg = html;
},
async updated() {
const res = await fetch(this.src);
const html = await res.text();
this.svg = html;
},
template: `
<span v-html="svg" />
`
}