Having value="Some value..." in your template means that the input's value will be set to the string "Some value..." initially. You need to bind the input's value to a data property on the component. Use v-model for a two-way binding (when the input value changes, it will update the value of the data property and vice versa).
In your example there's actually a bit more involved though since you want to obtain the input's value from the root component, therefore the <simple-input> component must expose this; the way to do this is by using props (for parent-to-child data flow) and events (for child-to-parent data flow).
Untested:
Vue.component('simple-input', {
template: `
<input type="text" :value="value" @input="$emit('input', $event.target.value)">
`,
props: ['value'],
});
<div id="root">
<simple-input v-model="value1"></simple-input>
<simple-input v-model="value2"></simple-input>
<simple-input v-model="value3"></simple-input>
<button @click="alertSimpleInput1">Show first input value</button>
<button @click="changeInput1('new value')">Change input value</button>
<button @click="alertSimpleInput2">Show second input value</button>
</div>
new Vue({
el: '#root',
data: {
value1: 'Initial value 1',
value2: 'Initial value 2',
value3: 'Initial value 3',
},
methods: {
alertSimpleInput1() {
alert(this.value1);
},
alertSimpleInput2() {
alert(this.value2);
},
changeInput1(newValue) {
this.value1 = newValue;
},
},
});
I understand you're just learning Vue, but there's a lot to unpack here for a beginner. I won't go into detail because there's lots of information about these concepts already.
Read the following: