560 vue 练习1

560 vue 练习1


560 vue 练习1


560 vue 练习1


560 vue 练习1


560 vue 练习1


560 vue 练习1


560 vue 练习1

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

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="app">
    <div>
      <p>num {{ num }}</p>
      <p>double1 {{ double1 }}</p>
      <input v-model="double2" />
    </div>
  </div>

  <script src="./vue.js"></script>
  <!-- <script src="./node_modules/vuex/dist/vuex.js"></script> -->

  <script>
    const vm = new Vue({
      el: '#app',
      data() {
        return {
          num: 20,
        };
      },
      computed: {
        double1() {
          return this.num * 2;
        },
        double2: {
          get() {
            return this.num * 2;
          },
          set(val) {
            this.num = val / 2;
          },
        },
      },
    })
  </script>

</body>

</html>



















































上一篇:GD库如何进行分类选择?


下一篇:GD库如何进行分类选择?