Vue实现计算器计算效果
本文实例为大家分享了Vue实现计算器计算效果的具体代码,供大家参考,具体内容如下
compare *{ padding:0; margin:0; box-sizing:border-box; } body{ background-color:#000000; } .panle{ border:1pxsolid#5f5f5f; width:100vw; height:29vh; font-size:3.8125rem; color:#FFFFFF; text-align:right; position:relative; } .curr{ display:block; position:absolute; width:inherit; bottom:0; font-size:3.5rem; } .operation{ display:block; position:absolute; width:inherit; bottom:80px; font-size:2.875rem; } .prev{ font-size:2.875rem; display:block; position:absolute; width:inherit; bottom:8rem; } .keyboad{ display:flex; flex-flow:rowwrap; margin:0calc((8vw-16px)/2); } .key{ display:inline-block; border:1pxsolid#333; width:23vw; height:23vw; border-radius:50%; text-align:center; font-size:30px; line-height:23vw; margin:2px; background-color:#616161; color:#ffffff; cursor:pointer; outline:none; border:none; box-shadow:09px#999; } .key:active{ box-shadow:05px#666; transform:translateY(4px); } .key:last-child{ border-radius:30%; flex-grow:1; margin:0; } .highlight{ background-color:#e77919; } {{prevNum}} {{operation}} {{currNum}}