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

"literal" modifier on custom directive causes v-if to be ignored #2707

Closed
decademoon opened this issue Apr 22, 2016 · 4 comments
Closed

"literal" modifier on custom directive causes v-if to be ignored #2707

decademoon opened this issue Apr 22, 2016 · 4 comments
Assignees
Labels

Comments

@decademoon
Copy link
Contributor

Vue.js version

1.0.21

Reproduction Link

http://jsfiddle.net/5sH6A/317/

@blake-newman
Copy link
Member

Quick fix: <div v-test.literal="" v-if="false" >1. This should not be visible</div>

Placing the literal before v-if resolves this bug for a quick fix. This is indeed a bug.

@yyx990803 Assigning to myself to look at.

@blake-newman blake-newman self-assigned this Apr 23, 2016
@blake-newman
Copy link
Member

blake-newman commented Apr 23, 2016

@vuejs/collaborators FYI

This is due to the modifiers of directives being parsed to previous directives. so .literal is being fed to the previous directive even though it's not applied to that directive.

@simplesmiler
Copy link
Member

Wowsie.
Does not happen with every directive/modifier though, e.g. @click="doSomething" @mouseover.prevent does not prevent the click default.

@blake-newman
Copy link
Member

@simplesmiler Happens with terminable directives

Found the issue and creating PR now

yyx990803 pushed a commit that referenced this issue Apr 24, 2016
)

- Fixes #2707
- Terminal directives where incorrectly revieving modifiers from other inline directives
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants