Welcome to OGeek Q&A 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 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...