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

mustache in class compiles to undefined #2085

Closed
xuanyan0x7c7 opened this issue Dec 25, 2015 · 1 comment
Closed

mustache in class compiles to undefined #2085

xuanyan0x7c7 opened this issue Dec 25, 2015 · 1 comment

Comments

@xuanyan0x7c7
Copy link

var child = {
  template: '<div class="one"></div>'
}
var parent = {
  template: '<child class="pre-{{name}}"></child>',
  data() {
    return {name: "two"}
  },
  components: {child}
}

It compiles to <div class="one pre-undefined"></div>.
The bug won't appear if there is no class attribute on the root of child component.

@yyx990803
Copy link
Member

Note after the fix, the parent class will overwrite the child class. This is because class="{{ abc }}" always sets the entire class. If you want to preserve child class you should still use v-bind:class instead.

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

2 participants