I am looking to update an image and trigger an image update.
Here is a demo example: http://jsbin.com/kuluyike/3/edit?html,js,output
<div id="colorPicker">
<img v-bind:src="color" :alt="color">
<ul>
<li v-for="c in colors">
<label>
<input type="radio" :id="c.name" name="color" v-model="color" :value="c.image">
{{c.name}}
</label>
</li>
</ul>
</div>
var cp = new Vue({
el: '#colorPicker',
data: {
colors: [
{
name: 'red',
image: 'red.jpg'
},
{
name: 'pink',
image: 'pink.jpg'
},
{
name: 'blue',
image: 'blue.jpg'
}
],
color: 'red.jpg'
}
});
However, this code does not work with Vue.js version 2.x.
How can I modify the code to make it compatible with version 2.x?