当前位置:网站首页>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
}
},边栏推荐
- 《基于R语言的自动数据收集》--第3章 XML和JSON
- Mysql为什么 建立数据库失败
- Why does Mysql fail to create a database
- An IP conflict is reported after installing the software on a dedicated computer terminal
- 算法拾遗十五补链表相关面试题
- 常用的遍历map的方法
- 栈与队列的基本介绍和创建、销毁、出入、计算元素数量、查看元素等功能的c语言实现,以及栈的压入、弹出序列判断,栈结构的链式表示与实现
- Win10 设置锁屏壁纸提示尝试其它图片
- [Shanghai] Hiring .Net Senior Software Engineer & BI Data Warehouse Engineer (Urgent)
- 双向循环带头链表
猜你喜欢

RNote108---Display the running progress of the R program

二叉搜索树问题

MongoDB 语法大全

Week 8 Document Clustering(文本聚类)

在anaconda Promat界面import torch通过,在jupyter notebook中报错的问题(仅提供思路理解!)

Flink Learning 10: Use idea to write WordCount and package and run

Use of thread pool (combined with Future/Callable)

TCP sticky packet unpacking problem + solution

Flink学习10:使用idea编写WordCount,并打包运行

线程池的使用(结合Future/Callable使用)
随机推荐
Mysql 死锁和死锁的解决方案
MySQL:连接查询 | 内连接,外连接
Redis 全套学习笔记.pdf,太全了
数据库——概述
Mysql为什么 建立数据库失败
今天虚竹哥又发现了一款好用的国产化API工具
算法拾遗十五补链表相关面试题
线程池的使用(结合Future/Callable使用)
Re regular expressions
TRACE32——加载符号表信息用于调试
Week 8 Document Clustering(文本聚类)
奇怪的Access错误
props 后面的数据流是什么?
Modeling of the MAYA ship
After working for 3 years, I recalled the comparison between the past and the present when I first started, and joked about my testing career
【win7】NtWaitForKeyedEvent
【Dynamic type detection Objective-C】
游戏思考19:游戏多维计算相关:点乘、叉乘、点线面距离计算
Rapid Medical's Ultra-Small and Only Adjustable Thromb Retriever Receives FDA Clearance
Week 8 Document Clustering