0👍
You would create a method that takes your item and returns a style or class string, object or array. Then bind the return value to your style or class.
<div :style='getStyle(item)' :class='getClass(item)' />
getStyle(item) {
// your logic returning a style object
}
getClass(item) {
// your logic returning a string, string array, or object.
}
You can find more details here:
https://v2.vuejs.org/v2/guide/class-and-style.html
Source:stackexchange.com