当前位置:网站首页>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
}
},边栏推荐
猜你喜欢

In the anaconda Promat interface, import torch is passed, and the error is reported in the jupyter notebook (only provide ideas and understanding!)

配合屏幕录像专家,又小又清晰!

Hash 这些知识你也应该知道

Week 8 Document Clustering(文本聚类)

protobuf is compiled against the associated .proto file

Redis 全套学习笔记.pdf,太全了

TRACE32——Break

二叉搜索树问题

性能提升400倍丨外汇掉期估值计算优化案例

Flink Learning 12: DataStreaming API
随机推荐
MySQL: order by sorting query, group by grouping query
Bluetooth gap protocol
Mysql 死锁和死锁的解决方案
对数据类型而言运算符无效。运算符为 add,类型为 text。
Mysql master-slave delay reasons and solutions
C# FileSystemWatcher
DeFi 前景展望:概览主流 DeFi 协议二季度进展
Flink Learning 11: Flink Program Parallelism
Shiny02---Shiny exception solution
400 times performance improvement 丨 swap valuation optimization case calculation
线程池的使用(结合Future/Callable使用)
C-Eighty seven(背包+bitset)
2006年星座运势全解-射手
栈与队列的基本介绍和创建、销毁、出入、计算元素数量、查看元素等功能的c语言实现,以及栈的压入、弹出序列判断,栈结构的链式表示与实现
RK3568环境安装
MAYA大炮建模
RNote108---显示R程序的运行进度
How to avoid online memory leaks
【深度学习实践(一)】安装TensorFlow
Week 8 Document Clustering(文本聚类)