a bug of"undefined" when using slot
See original GitHub issueVue.js version
2.1.7
Reproduction Link
https://jsfiddle.net/jkin8010/j7s5prkv/5/
Steps to reproduce
Icon.vue
<template>
<i :class="className"></i>
</template>
<script>
export default {
props: {
type: String
},
computed: {
className () {
return `c-icon c-icon-${this.type}`
}
}
}
</script>
Hello.vue
<template>
<div class="hello">
<icon type="clear"></icon>
<slot name="right"><slot>
</div>
</template>
<script>
import Icon from './icon.vue';
export default {
components: {
Icon
}
}
</script>
App.vue
<template>
<div id="app">
<hello>
test2
</hello>
</div>
</template>
<script>
import Hello from './Hello'
export default {
components: {
Hello
}
}
</script>
What is Expected?
What is actually happening?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Vue slot is not working in rare and unpredictable cases ...
I noticed you are working with objects and turning them into arrays. Objects properties can be problematic to work with, because unlike arrays ......
Read more >611653 - Assertion failure: obj->containsSlot(slot) - Bugzilla@Mozilla
It seems to me that's probably a bug in the extension's use of JSAPI, ... 0x11d325f60 slots: 0 (reserved) = undefined 1 (reserved)...
Read more >Empty slots Lesson - JavaScript Arrays - Execute Program
When we use new Array , the array appears to be full of undefined . · > new Array(1)[0]; · However, the slot...
Read more >Docs • Svelte
Components can be placed in a named slot using the syntax <Component slot="name" /> . In order to place content in a slot...
Read more >error in nexttick: "typeerror: cannot read properties ... - You.com
Here's an example of a JavaScript TypeError: Cannot read property of undefined thrown when a property is attempted to be read on an...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
see #6793
With vue@2.4.4/vue-template-compiler@2.4.4 and before, it was fine:
but upgraded them both to the latest: 2.5.0, the weird “undefined” show up again:
Is it bug of element-ui or vue?
Related: https://github.com/vuejs/vue/issues/4993, https://github.com/fritx/vue-at/issues/3