ES6对象字面量增强写法

<script>
  const id = 1;
  const name = 'furong';
  const age = 12;

  const obj = {
    id,
    name,
    age
  };

  console.log(obj);
</script>

ES6对象字面量增强写法

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <script src="https://unpkg.com/vue/dist/vue.js"></script>
  </head>
  <body>
    <div id="app">
      <p>{{ message }}</p>
      <p>{{ fullName }}</p>
    </div>

    <script>
      const app = new Vue({
        el: '#app',
        data: {
          message: 'Hello Vue.js!',
          firstName: "thomas",
          lastName: "zhang",
        },
        computed: {
          fullName() {
            return this.firstName + ' ' + this.lastName;
          }
        }
      })
    </script>
  </body>
</html>

ES6对象字面量增强写法

上一篇:pysimplegui之读写配置项操作


下一篇:pysimplegui之调试输出(easy_print = Print = eprint)