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

Undefined opts when use yield (v2.6.2) #1990

Closed
1 of 7 tasks
syuilo opened this issue Sep 22, 2016 · 1 comment
Closed
1 of 7 tasks

Undefined opts when use yield (v2.6.2) #1990

syuilo opened this issue Sep 22, 2016 · 1 comment

Comments

@syuilo
Copy link
Contributor

syuilo commented Sep 22, 2016

When use yield, value of this.opts will be undefined.

ℹ️ This bug only occurs on v2.6.2.

<my-tag>
  <my-container>
    <my-x message={ message }></my-x>
  </my-container>

  <script>
    this.message = 'hello there'
  </script>
</my-tag>
<my-container>
  <yield />
</my-container>
<my-x>
  <h1>{ message }</h1>

  <script>
    this.message = this.opts.message // <- undefined
  /*
    console.log(this.opts)
      => { message: undefined }
  */
  </script>
</my-x>

Repoduce Code
http://plnkr.co/edit/ffnPUvlfqkiPmN8G3Da3?p=info

Riot: 2.6.2

  • Question
  • Bug
  • Discussion
  • Feature request
  • Tip
  • Enhancement
  • Performance

Thanks. 🍕

@syuilo syuilo changed the title Undefined opts when use yield Undefined opts when use yield (v2.6.2) Sep 22, 2016
@GianlucaGuarini
Copy link
Member

closing duplicate of #1866 #1973
riot yield tags expressions get evaluated using the values of the tag where they get injected

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

No branches or pull requests

2 participants