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)

vue 双向绑定多个子组件, 不同绑定值,显示不同css 样式

父组件中:

 <div>
    <ticketFormDetails
      text="指定时间"
      :value="assignDatetime | dateFormatSecondZero"
    ></ticketFormDetails>
  </div>
  <div>
    <ticketFormDetails
      text="编号"
      :value="businessId"
    ></ticketFormDetails>
  </div>
  

子组件:

<div class="">
  <el-col :span="8" :push="2">
    <div>
      &nbsp;{{ `${text}:` }}
    </div>
  </el-col>
  <el-col :span="15" :push="1">
    <div class="">
      <label class="">{{ value }}</label>
    </div>
  </el-col>
</div>
如何让 
:value="assignDatetime | dateFormatSecondZero"显示红色
:value="businessId" 显示黑色?

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

1 Answer

0 votes
by (71.8m points)

你搞一个color值传进去不就好了?


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

...