Vue · Senior · Question 29 of 75

Why is binding user-controlled values to :style risky?

Explanation

Prefer binding only specific properties (e.g. color) from user input, validated against an allow-list, and never a whole user-provided style object.

Further reading

Problem with a question

Vue · Senior · question 29

Test yourself

Take the Vue · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz