1. <template>
    2. <div id="app">
    3. <input type="text" v-model="msg">
    4. </div>
    5. </template>
    6. <script lang="ts">
    7. import { Vue,Component,Watch } from "vue-property-decorator";
    8. @Component({})
    9. export default class App extends Vue {
    10. private msg:string = "hello world"
    11. @Watch("msg")
    12. onMsg(val:string):void{
    13. console.log(val)
    14. }
    15. }
    16. </script>