<template> <div class="card-info-color" :style="'background:'+ defaultColor()"></div> </template> <script> export default { methods: { defaultColor() { let dc = ['#ff92c3', '#86c2ff', '#73e38d']; return dc [Math.floor(Math.random() * dc.length)] }, } } </script>