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

How to apply color from color picker to an element? #204

Open
kentforth opened this issue Jun 16, 2020 · 1 comment
Open

How to apply color from color picker to an element? #204

kentforth opened this issue Jun 16, 2020 · 1 comment

Comments

@kentforth
Copy link

I have a view where I use photoshop color picker:

<div class="color-picker">
     <photoshop-picker v-model="color"/>
</div>

I have an element where I want to change background color:

<textarea
	name="category-textarea"
        id="category-textarea"
	cols="30"
	rows="1"
        :style="{ backgroundColor: color }"
        ></textarea>

I imported it in script area like this:

<script>
import { Photoshop } from "vue-color";
export default {
	components: {"photoshop-picker": Photoshop },
	mounted() {},
	data() {
		return {
			color: "#7163E0"
		};
	}
};
</script>

How can I apply color from color picker to background color of textarea?

@kentforth kentforth changed the title How to apply color from color picker to element? How to apply color from color picker to an element? Jun 16, 2020
@hurradieweltgehtunter
Copy link

hurradieweltgehtunter commented Apr 28, 2021

try

:style="{ 'background-color': color; }"

(not tested)

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