Issue #2728Opened April 22, 2020by ajumell0 reactions

[QUESTION] How can I set the background image of a component programtically.

Question

Hello,

I want to create an option to change background of a component by double clicking it. I could open the modal when double clicking it. But how can I se the background-image property using it. I checked the codebase couldn't find a clue. Have any one done something similar. Please provide some suggestions or leads.

Answers (1)

artfApril 23, 20200 reactions

@ajumell when, for example, you select the background to apply you can change the component background in this way

component.addStyle({ 'background-image': `url('${url}')` })

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.