Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.0k views
in Technique[技术] by (71.8m points)

修改el-timeline-item的左侧第一个节点颜色,修改后无效

修改遍历生成的第一个子节点的左侧圆点颜色,修改后无法生效生效
<el-timeline>

<el-timeline-item
  v-for="(activity, index) in activities"
  :key="index"
  :timestamp="activity.timestamp" placement="top">
  <el-card>
    <h4>{{activity.userName}}</h4>
    <p>{{activity.details}}</p>
  </el-card>
</el-timeline-item>

</el-timeline>
<style scoped>

.el-timeline-item__node:first-child{
background-color: #95F204;
}
</style>
设置的>>> .el-timeline-item__node:first-child{
background-color: #95F204;
}无法生效
image
如何可以使只有第一个节点的圆点颜色改变,其他颜色不变?

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

看文档image.png
:color="index === 0 ? '#95F204' : ''"


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...