Vue.js

Vue.js是一個用於建立使用者介面的開源JavaScript框架,也是一個建立單頁面應用的Web應用框架。Vue.js是一款流行的JavaScript前端框架,旨在更好地組織與簡化Web開發。Vue所關注的核心是MVC模式中的視圖層,同時,它也能方便地取得資料更新,並通過元件內部特定的方法實現視圖與模型的互動。

Vue.component('buttonclicked', {
  props: ["initial_count"],
  data: function() {var q = {"count": 0}; return q;} ,
  template: '<button v-on:click="onclick">Clicked {{ count }} times</button>'
  ,
  methods: {
    "onclick": function() {
        this.count = this.count + 1;
    }
  },
  mounted: function() {
    this.count = this.initial_count;
  }
});

sss

this.count = this.count + 1;

results matching ""

    No results matching ""