Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a bug of"undefined" when using slot #4581

Closed
jkin8010 opened this issue Dec 27, 2016 · 5 comments
Closed

a bug of"undefined" when using slot #4581

jkin8010 opened this issue Dec 27, 2016 · 5 comments

Comments

@jkin8010
Copy link

jkin8010 commented Dec 27, 2016

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?

@jkin8010 jkin8010 changed the title slot出现undefined slot出现undefined there is a bug Dec 27, 2016
@jkin8010 jkin8010 changed the title slot出现undefined there is a bug when using slot will be a bug of "undefined" Dec 27, 2016
@jkin8010 jkin8010 changed the title when using slot will be a bug of "undefined" a bug of"undefined" when using slot Dec 27, 2016
@yyx990803
Copy link
Member

Thanks for filing the issue. Please follow the Issue Reporting Guidelines and provide a minimal JSFiddle or JSBin containing a set of reproducible steps that can lead to the behavior you described.

@yyx990803
Copy link
Member

fixed by #4572

@fritx
Copy link

fritx commented Jan 12, 2017

The bug seems persisted in 2.1.8 😕
See the two referenced issues.

This was referenced Jan 18, 2017
@fritx
Copy link

fritx commented Oct 13, 2017

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: #4993, fritx/vue-at#3

@posva
Copy link
Member

posva commented Oct 13, 2017

see #6793

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants