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

Allow use number as value of size property in inline style #84

Closed
wspl opened this issue Oct 14, 2019 · 1 comment
Closed

Allow use number as value of size property in inline style #84

wspl opened this issue Oct 14, 2019 · 1 comment

Comments

@wspl
Copy link

wspl commented Oct 14, 2019

Current:

<template>
  <div :style="{ height: size + 'px'}"></div>
</template>
<script>
export default {
  data () {
    return {
      size: 10
    }
  }
}
</script>

Expect:

<template>
  <div :style="{ height: size }"></div>
</template>
<script>
export default {
  data () {
    return {
      size: 10
    }
  }
}
</script>

Similar to the design in React, the numeric value in the style sheet object is automatically added “px” as unit.

@posva
Copy link
Member

posva commented Oct 14, 2019

Duplicate of vuejs/vue#8759
Let's keep the discussion there

@posva posva closed this as completed Oct 14, 2019
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