-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Closed
Description
Came across this strange bug today.
html:
<foo>
<div slot="a" v-if="false"></div>
<!-- <div slot="a" v-if="true">No warnings if v-if="true"</div> -->
</foo>
js:
var vm = new Vue({
el: 'body',
components: {
foo: {
template: `
<slot name="a">
<div @click="bar"></div>
</slot>
`,
methods: {
bar() { /* do something */ }
}
}
}
})
gives:
[Vue warn]: v-on:click="bar" expects a function value, got undefined.
Fiddle:
https://jsfiddle.net/fnlCtrl/ce1Lc0xs/
(Happy new year by the way :D)
Metadata
Metadata
Assignees
Labels
No labels