# unaipp 常用总结

# 🧩01:常用css


	:style="getStyleClassBg(index)"

    methods: {
        getStyleClassBg(index) {
            let bgColor = '#1BB8AF'
            let textColor = '#fff'
            
            switch (index) {
                case 0:
                    bgColor = '#1BB8AF'
                    break;
                case 1:
                    bgColor = '#D14F47'
                    break;
                case 2:
                    bgColor = '#999'
                    break;
            }
            
            return {
                backgroundColor:bgColor,
                color:textColor
            }
        },
    }

✅ Copy success!