I am attempting to dynamically bind an image path inside a method. It seems feasible, but I'm uncertain if I am implementing the code correctly. Can someone review it? Essentially, I want to retrieve the selected image from the model rather than hardcoding the URL within the displayed text.
new Vue({
el: "#app",
data: {
imagesPathArr:[],
selectedImage2: 'https://upload.wikimedia.org/wikipedia/commons/f/f9/Phoenicopterus_ruber_in_S%C3%A3o_Paulo_Zoo.jpg',
},
methods: {
toggle: function(todo){
todo.done = !todo.done
},
greet: function (event) {
alert("test");
window.Core.ExecuteCommand({
name: 'mceInsertContent',
value: '<img :src="selectedImage2" width="600px;" alt="text here" />'
}, 'topicContent$html');
},
}
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<div id="app">
<button v-on:click="greet">Click ME</button>
</div>