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
3.2k views
in Technique[技术] by (71.8m points)

if 和做到优雅的判断状态

根据状态显示下列个个按钮,比如-1的时候只展示订单详情,0代付款需要展示 订单详情,去付款,取消订单...

/**
 * 订单状态 -1订单取消 0代付款 10 待发货 20 待发货|待取货 30待收货 40待确认 50 待评价 60 完成
 */
 <div class="r">
    <div class="btn" v-if="">订单详情</div>
    <div class="btn" v-if="">申请退款</div>
    <div class="btn" v-if="">发票申请</div>
    <div class="btn" v-if="">取消订单</div>
    <div class="btn" v-if="">去付款</div>
</div>

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

1 Answer

0 votes
by (71.8m points)

这样挺好,你的优雅是指代码少?


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

...