Open retroriff opened 3 years ago
To dynamically import an SVG, we can use the inline require() syntax.
<template> <div v-html="require(`../assets/${name}.svg?raw`)" /> </template> <script> export default { props: { name: { type: String, default: "image" }, }, }; </script>
As far as I now, this method does not allow to dynamically pass a title and a description to the inline SVG, which would be great for accessibility on multilanguage sites.
To dynamically import an SVG, we can use the inline require() syntax.
As far as I now, this method does not allow to dynamically pass a title and a description to the inline SVG, which would be great for accessibility on multilanguage sites.