- Ruby / Rails以外の開発一般
READ MORE
ポイント: $once()
で定義したコードは、$emit
で「1度だけ」実行されます。
created: function() {
this.$once("foo", function(e) { this[e.target.dataset.key] += 1 })
},
methods: {
a: function(e) { this.$emit("foo", e) },
},