[Vuejs]-Style.display not working in Vue JS swatch project

0👍

You should rely on v-show or v-if for conditional rendering.

You can set a variable inside your data to true and use that for showing/hiding fields.

<b-form-input
        id="name"
        size="lg"
        type="text"
        class="search-bar-2"
        placeholder="Name Your Swatch, Enter Hit the Save Edit Button"
        v-model="value3"
        @keypress="republishSwatch"
        v-show="shouldShow"
        >
</b-form-input>

Set shouldShow from inside a listener on your button.

There are very few cases in which you should manipulate the DOM directly.

Leave a comment