diff --git a/if-else.html b/if-else.html new file mode 100644 index 0000000..dc8821c --- /dev/null +++ b/if-else.html @@ -0,0 +1,49 @@ + + + + + + + + 方圆书院 + + +
+

+ // 修复v-if v-else重复事件绑定的问题 +

+
确认订购if
+
确认订购else
+
+ + + + + \ No newline at end of file diff --git a/vue-tap.js b/vue-tap.js index 6ab884b..32b87c2 100644 --- a/vue-tap.js +++ b/vue-tap.js @@ -123,6 +123,7 @@ var vue2 = { bind: function (el, binding) { + console.log(binding) el.tapObj = {}; el.handler = function (e,isPc) { //This directive.handler var value = binding.value; @@ -183,6 +184,10 @@ !isPc ? value.tapObj = el.tapObj : null; value.methods.call(this, value); }; + }, + unbind: function (el) { + // 卸载,别说了都是泪 + el.handler = function () {}; } };