Skip to content

a bug of"undefined" when using slot  #4581

@jkin8010

Description

@jkin8010

Vue.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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions