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

Style and Class binding improvements #194

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

CyberAP
Copy link
Contributor

@CyberAP CyberAP commented Jul 22, 2020

Rendered

Introduce a couple of improvements to Style and Class bindings:

  • Secondary argument for direct prop-value bindings

    <input :class:is-active="isActive">
  • Modifiers for secondary style arguments

    <input :style:custom-property.prop="customPropertyValue">
    <input :style:width.px="width">

@posva
Copy link
Member

posva commented Jul 23, 2020

This was asked for before at vuejs/vue#4956
Same for implicit prop values vuejs/vue#2877

Given the existing syntax for directives (like v-bind) this introduces a custom attribute named class:property (property being dynamic) and a custom behavior for v-bind, which ironically helps to making things overcomplicated which is your first point in motivation

@CyberAP
Copy link
Contributor Author

CyberAP commented Jul 23, 2020

It does not introduce a custom attribute and is a syntax sugar for an existing object configuration for v-bind. That's why it said that users who use render functions won't be affected by this change.

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

Successfully merging this pull request may close these issues.

2 participants