Closed r1m closed 6 years ago
Reactivity fails : If we create an icon with dynamic name with initial value set to an non existing id, it is not rendered when the name value change.
<template> <div> <svgicon :icon="name" /> <button @click="changeIcon">Test</button> </div> </template> <script> import svgicon from 'vue-svgicon'; export default { name: 'MyIcon', components: { svgicon, }, data() { return { name: '' }; }, methods: { changeIcon() { this.name = 'icon'; }, }, }; </script>
If name is initialized with an existing icon name, it works.
My guess is that this line is the problem https://github.com/MMF-FE/vue-svgicon/blob/master/component/svgicon.vue#L62
loaded is only evaluated when the component is created
loaded
Reactivity fails : If we create an icon with dynamic name with initial value set to an non existing id, it is not rendered when the name value change.
If name is initialized with an existing icon name, it works.