// app.js
import Hex from './Hex';
new Vue({
el: '#app',
data: {
// hex has a property called 'value'
hex: new Hex,
},
watch: {
'hex.value'() {
alert('This is not triggered');
}
}
});
But when I change hex:new Hex to hex: {value: ''}, the watcher is working.
I've never seen vue written like that, so I could be off here, but I think it could stem from the quotations around your variable, so maybe try changing it to:
watch: {
hex.value(val) {
alert('This is not triggered');
}
}