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

Comments

@wspl
Copy link

@wspl 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

This comment has been minimized.

Copy link
Member

@posva posva commented Oct 14, 2019

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

@posva posva closed this Oct 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.