绿色背景颜色效果为啥没出来???
<template> <ul> <li v-for="(item,index) in lists" @click="choose(index)" :class="{active:index==current}" :key="index"> {{item}} </li> </ul> </template> <script> export default { name:"demo1", data() { return { lists: [1, 2, 3, 4, 5, 6, 7, 8, 9] } }, methods: { choose(index){ console.log(index) } } } </script> <style scoped> li.active{ background: green; } </style>