We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent af0f69a commit cee5b57Copy full SHA for cee5b57
test/unit/specs/directives/events_spec.js
@@ -90,5 +90,39 @@ if (_.inBrowser) {
90
})
91
92
93
+ it('should be able to switch handlers if not a method', function (done) {
94
+ var a = 0
95
+ var b = 0
96
+ var vm = new Vue({
97
+ el: el,
98
+ data: {
99
+ handle: function () {
100
+ a++
101
+ }
102
+ },
103
+ template: '<div v-component="test" v-events="test:handle"></div>',
104
+ components: {
105
+ test: {
106
+ compiled: function () {
107
+ this.$emit('test')
108
109
110
111
+ })
112
+ _.nextTick(function () {
113
+ expect(a).toBe(1)
114
+ expect(b).toBe(0)
115
+ vm.handle = function () {
116
+ b++
117
118
119
+ vm._children[0].$emit('test')
120
121
+ expect(b).toBe(1)
122
+ done()
123
124
125
126
+
127
128
}
0 commit comments