When I start typing in the input field I want to get this data in console, but currently it is empty. What am I doing wrong?
HTML:
<products-list v-model="product.name" v-on:keyup="productName"></products-list>
JS:
Vue.component('products-list', {
template:
`<input class="product_name form-control" contenteditable="true"></input>`,
});
var app = new Vue({
el: '#app',
data: {
items: items,
product: {
name: "",
}
},
methods: {
productName: function() {
console.log(product.name);
}
}
});