加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Vue.js实现的计算器功能完整示例

发布时间:2020-12-17 03:08:34 所属栏目:百科 来源:网络整理
导读:本篇章节讲解Vue.js实现的计算器功能。供大家参考研究具体如下: 1. HTML部分代码 my-calculator 2. CSS部分代码 div{margin:0 auto}div{text-align:left}a img{border:0}body{color:#333;text-align:center;font:12px "微软雅黑";}ul,li{list-sty

本篇章节讲解Vue.js实现的计算器功能。分享给大家供大家参考,具体如下:

1. HTML部分代码

2. CSS部分代码

div{margin:0 auto} div{text-align:left} a img{border:0} body{color:#333;text-align:center;font:12px "微软雅黑";} ul,li{list-style-type:none;vertical-align:0} a{outline-style:none;color:#535353;text-decoration:none} a:hover{color:#D40000;text-decoration:none} .clear{height:0;overflow:hidden;clear:both} /* calculator */ #calculator{width:200px;height:245px;padding:10px;border:1px solid #e5e5e5;background:#f8f8f8;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;box-shadow:0px 0px 10px #f2f2f2;-moz-box-shadow:0px 0px 10px #f2f2f2;-webkit-box-shadow:0px 0px 10px #f2f2f2;margin:40px auto 0 auto;} #calculator #input-box{margin:0;width:187px;padding:9px 5px;height:14px;border:1px solid #e5e5e5;border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;background:#FFF;text-align:right;line-height:14px;font-size:12px;font-family:Verdana,Geneva,sans-serif;color:#666;outline:none; text-transform:uppercase;} #calculator #btn-list{width:200px;overflow:hidden;} #calculator #btn-list .btn-radius{border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px;border:1px solid #e5e5e5;background:-webkit-gradient(linear,0 0,0 100%,from(#f7f7f7),to(#ebebeb));background:-moz-linear-gradient(top,#f7f7f7,#ebebeb);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#f7f7f7,endColorstr=#ebebeb,grandientType=1);line-height:29px;text-align:center;text-shadow:0px 1px 1px #FFF;font-weight:bold;font-family:Verdana,sans-serif;color:#666;float:left;margin-left:11px;margin-top:11px;font-size:12px;cursor:pointer;} #calculator #btn-list .btn-radius:active{background:#ffffff;} #calculator #btn-list .clear-marginleft{margin-left:0;} #calculator #btn-list .font-14{font-size:14px;} #calculator #btn-list .color-red{color:#ff5050} #calculator #btn-list .color-blue{color:#00b4ff} #calculator #btn-list .btn-30{width:29px;height:29px;} #calculator #btn-list .btn-70{width:70px;height:29px;}

3. 使用本站HTML/CSS/JS在线运行测试工具:,可得到如下测试运行效果:

4. 使用时记得改下css路径,在html中引入vue

5. 博主技术有限,正负号部分功能还有问题待完善.计算器还有一些未知的小Bug,感兴趣的读者可以在这个基础上进行扩展。

PS:这里再为大家推荐几款计算工具供大家参考:

在线数学表达式简单转换/计算工具:

在线一元函数(方程)求解计算工具:

科学计算器在线使用_高级计算器在线计算:

在线计算器_标准计算器:

希望本文所述对大家vue.js程序设计有所帮助。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读