修改
This commit is contained in:
44
src/views/home/components/finishDiv.vue
Normal file
44
src/views/home/components/finishDiv.vue
Normal file
@@ -0,0 +1,44 @@
|
||||
<template>
|
||||
<!-- 显示累计值,并绑定颜色类 -->
|
||||
<div class="accumulated-value" :class="injectData.status">
|
||||
{{ injectData.accumulated }} <!-- 显示累计数据 -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'finishDiv', // 补充组件名,便于识别
|
||||
props: {
|
||||
injectData: { // 接收父组件传递的当前行数据
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// list: this.injectData // 将接收的行数据赋值给list,便于模板使用
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 若无需输入功能,可删除changeInput方法;若需保留,可按需调整
|
||||
// changeInput() {
|
||||
// console.log(this.list)
|
||||
// this.$emit('emitData', this.list)
|
||||
// }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 累计值基础样式 */
|
||||
|
||||
/* 已完成:绿色 #4CAF50 */
|
||||
.accumulated-value.done {
|
||||
color: #4CAF50;
|
||||
}
|
||||
|
||||
/* 未完成:橙色 #FF9800 */
|
||||
.accumulated-value.pending {
|
||||
color: #FF9800;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user