<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div >
        <button @click="btnClick">click</button>
        <button @click="btnReset">reset</button>
        <p><input type="text" v-model="message"></p>
        <p>{{message}}</p>
    </div>
    <script src="./vue.js"></script>
    <script>
        let vm = new Vue({
            el: "#app",
            data() {
                return {

                    message: ''
                }
            },
            methods: {
                btnClick() {
                    this.message = 'bbbbbbbbbb'
                },
                btnReset() {
                    Object.assign(this.$data, this.$options.data.call(this))
                }
            },
        })
    </script>
</body>

</html>

相关文章:

  • 2021-07-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-04-28
  • 2021-09-17
  • 2022-12-23
  • 2021-08-06
  • 2021-10-25
相关资源
相似解决方案