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 vBind not working in Production Mode #4049

Closed
edisdev opened this issue Jul 1, 2021 · 2 comments
Closed

Style vBind not working in Production Mode #4049

edisdev opened this issue Jul 1, 2021 · 2 comments

Comments

@edisdev
Copy link

edisdev commented Jul 1, 2021

Version

3.1.2

Reproduction link

vuejs/rfcs#231 (comment)

Steps to reproduce

I used the Js variable in the style tag. This feature is working in development mode but not in production mode. The reason is, the variable names created are different.

<template>
  <div class="Example">
    <div class="area">
      <div class="form">
        <label>Select Color</label>
        <input type="color" v-model="customTheme" />
      </div>
      <div class="preview">
        <span>{{ customTheme }}</span>
        <div class="customColor"></div>
      </div>
    </div>
  </div>
</template>

<script>
import { ref } from "vue";

export default {
   setup() {
    const customTheme = ref('');
    return {
      customTheme
    };
  },
};
</script>

<style>

.Example {
  --custom-color: v-bind("customTheme");
}
.customColor {
  background: var(--custom-color);
  width: 100px;
  height: 50px;
}
</style>

For example,

--7ba5bd90-customTheme => The name of the variable that is bind to this element.
var(--e8f15df8) => This is the name of the variable generated in the style.

Screen Shot 2021-07-02 at 00 53 31

What is expected?

I expected this feature run in production mode too.

What is actually happening?

This feature is working in development mode but not in production mode.

@edisdev edisdev changed the title Vue style vBind not working in Production Mode Style vBind not working in Production Mode Jul 1, 2021
@edison1105
Copy link
Member

duplicate of #3921

@posva
Copy link
Member

posva commented Jul 6, 2021

Duplicate of #3921

@posva posva marked this as a duplicate of #3921 Jul 6, 2021
@posva posva closed this as completed Jul 6, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Oct 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants