I define my vue component as a Typescript class thus:
import {Component} from 'vue-property-decorator'
import Vue from "vue";
@Component({})
export default class TestComponent extends Vue {
test:string;
}
and call it from my entry file thus:
let test = new TestComponent({el:'#element'});
attaching it to the following HTML:
<section id="element">
<h2>test is <span>{{test}}</span></h2>
<form>
<input type="text" name="test" v-model="test">
</form>
</section>
The component is initialised correctly and displays my test message, but the 'test' variable isn't binded - when I update the input field the value doesn't change, and I don't see any data binding when checking it on the Vue devtools.
Any advice?
Thanks, Y.