当前位置:网站首页>v-if/v-else根据计算判断是否显示
v-if/v-else根据计算判断是否显示
2022-08-05 07:25:00 【小布丁儿Y】
判断输入的金额*数量是否大于当前余额 或者小于等于当前余额 (两种状态)
大于当前余额
小于等于当前余额
html:
<view class="footer fc">
<view class="baseBtn" v-if="(amount<=this.balance)" @click="creatPay()">创建优惠券
</view>
<view class="baseBtn cur" v-else>余额不足,请先充值</view>
</view>
data:
data() {
return {
quota: '', //发放数量
couponAmount: '', //发放方式为固定时传 单个金额
balance:'', //余额
}
},
我是在computed去做处理的
computed:{
//判断单个金额*总数量是否大于余额
amount: function(){
return this.couponAmount * this.quota
}
},
边栏推荐
猜你喜欢
原来使Maya Arnold也能渲染出高质量作品!超赞小技巧
爬虫之验证码
MongoDB 语法大全
微信 小程序 之PC端 不支持 wx.previewMedia 方法 故用自定义轮播图进行 模拟照片视频的播放
在anaconda Promat界面import torch通过,在jupyter notebook中报错的问题(仅提供思路理解!)
In the anaconda Promat interface, import torch is passed, and the error is reported in the jupyter notebook (only provide ideas and understanding!)
今天虚竹哥又发现了一款好用的国产化API工具
Redis常用命令
TRACE32——C源码关联1
Week 8 Document Clustering
随机推荐
YOLOv3 SPP理论详解(包括CIoU及Focal loss)
TRACE32——SMP多核调试
[Tool Configuration] Summary of Common Uses of VSCode
Why does Mysql fail to create a database
Shiny04---Application of DT and progress bar in shiny
Unity—物理引擎+“武器模块”
任务流调度工具AirFlow,,220804,,
Summary of Text Characterization Methods
双向循环带头链表
400 times performance improvement 丨 swap valuation optimization case calculation
openSource 知:社区贡献
A small problem with mysql using the in function
MySQL: join query | inner join, outer join
Vulnhub target drone: HA_ NARAK
请问my sql如何把两个表的内容集合在一起啊?
693. 行程排序
外企Office常用英语
Flink学习12:DataStreaming API
Liunx教程超详细(完整)
binary search tree problem