秋林 做网站,wordpress数据库字典,哪个网站可以搭建网页,江苏省工程建设信息网站数字翻转的效果 实现数字翻转的效果上面为出来的样子
下面为代码#xff0c;使用的时候直接引入#xff0c;还有就是把图片的路径自己换成自己或者先用颜色替代#xff0c;传入num和numlength即可
templatediv v-for(item, index) in processedNums使用的时候直接引入还有就是把图片的路径自己换成自己或者先用颜色替代传入num和numlength即可
templatediv v-for(item, index) in processedNums :keyindex classfilp_boxdivclasscard-container:class{ entry: flipState[index] }v-ifitem .!-- div classline/div --div classcard1 card-item./divdiv classcard2 card-item./divdiv classcard3 card-item./divdiv classcard4 card-item./div/divdiv classcard-container :class{ entry: flipState[index] } v-else!-- div classline/div --div classcard1 card-item{{ item }}/divdiv classcard2 card-item{{ item }}/divdiv classcard3 card-item{{ item }}/divdiv classcard4 card-item{{ item }}/div/div/div
/templatescript
export default {props: {nums: {validator: function(value) {// 判断值是否为数字或者可以转换为数字的字符串return !isNaN(value) || typeof value string;},required: true,default: () 0,},numlength: {type: Number,default: 7,},},watch: {nums(newVal, oldVal) {// 重置所有翻转状态this.flipState this.processedNums.map(() false);let newnum this.processedNumsWatch(newVal);let oldnum this.processedNumsWatch(oldVal);// 使用$nextTick确保DOM已更新后再触发动画this.cleanTimer setTimeout(() {newnum.forEach((item, index) {if (item ! oldnum[index]) {this.flipState[index] true;}});}, 50);},numlength(newVal, oldVal) {// 重置所有翻转状态this.flipState this.processedNums.map(() false);},},data() {return {flipState: [], // 用于记录每个数字容器的翻转状态cleanTimer: null,};},computed: {// 计算属性来处理nums这里简单地假设处理逻辑是添加一个id字段processedNums() {let string this.nums.toString();// 字符串转数组let array Array.from(string);// 数组补0let valueArr this.padArray(array, this.numlength);return valueArr;},},methods: {// 补0padArray(arr, max) {while (arr.length max) {arr.unshift(0);}return arr;},processedNumsWatch(val) {let string val.toString();// 字符串转数组let array Array.from(string);// 数组补0let valueArr this.padArray(array, this.numlength);return valueArr;},},beforeDestroy() {clearTimeout(this.cleanTimer);},
};
/script
style scoped
.filp_box {display: inline-block;margin: 0 1px;
}
.card-container {width: 27px;height: 40px;/* background: #000000; */position: relative;
}
.line {position: absolute;z-index: 100;width: 100%;background-color: #fff;height: 3px;top: 49%;
}
.card-item {position: absolute;width: 100%;height: 50%;overflow: hidden;
}.card1 {font-size: 36px;font-family: myFontNum;font-weight: bold;line-height: 40px;text-align: center;color: #fff;background: url(./TTTT5.png) no-repeat center;
}.card2 {font-size: 36px;font-family: myFontNum;font-weight: bold;line-height: 0px;color: #fff;text-align: center;top: 50%;background: url(./BBBBBFD.png) no-repeat center;transform-origin: center top;backface-visibility: hidden;transform: rotateX(180deg);z-index: 2;
}.card3 {font-size: 36px;font-family: myFontNum;font-weight: bold;color: #fff;line-height: 40px;text-align: center;background: url(./TTTT5.png) no-repeat center;transform-origin: center bottom;backface-visibility: hidden;z-index: 2;
}.card4 {font-size: 36px;font-family: myFontNum;font-weight: bold;color: #fff;top: 50%;line-height: 0px;text-align: center;/* overflow: hidden; */background: url(./BBBBBFD.png) no-repeat center;
}.card-container.entry .card2 {transition: 0.5s;transform: rotateX(0deg);
}.card-container.entry .card3 {transition: 0.5s;transform: rotateX(-180deg);
}
/style使用示例 FlipCard :numspropsnum :numlength7 /
文章转载自: http://www.morning.mltsc.cn.gov.cn.mltsc.cn http://www.morning.gbyng.cn.gov.cn.gbyng.cn http://www.morning.baguiwei.com.gov.cn.baguiwei.com http://www.morning.mgskc.cn.gov.cn.mgskc.cn http://www.morning.beeice.com.gov.cn.beeice.com http://www.morning.fdsbs.cn.gov.cn.fdsbs.cn http://www.morning.yzxhk.cn.gov.cn.yzxhk.cn http://www.morning.wfqcs.cn.gov.cn.wfqcs.cn http://www.morning.mbmh.cn.gov.cn.mbmh.cn http://www.morning.rbffj.cn.gov.cn.rbffj.cn http://www.morning.fwjfh.cn.gov.cn.fwjfh.cn http://www.morning.qlry.cn.gov.cn.qlry.cn http://www.morning.ccjhr.cn.gov.cn.ccjhr.cn http://www.morning.rwpfb.cn.gov.cn.rwpfb.cn http://www.morning.ftwlay.cn.gov.cn.ftwlay.cn http://www.morning.nfpct.cn.gov.cn.nfpct.cn http://www.morning.zlrrj.cn.gov.cn.zlrrj.cn http://www.morning.jllnh.cn.gov.cn.jllnh.cn http://www.morning.npmpn.cn.gov.cn.npmpn.cn http://www.morning.yhplt.cn.gov.cn.yhplt.cn http://www.morning.tqklh.cn.gov.cn.tqklh.cn http://www.morning.snnwx.cn.gov.cn.snnwx.cn http://www.morning.drpbc.cn.gov.cn.drpbc.cn http://www.morning.fyxtn.cn.gov.cn.fyxtn.cn http://www.morning.jyjqh.cn.gov.cn.jyjqh.cn http://www.morning.yqmmh.cn.gov.cn.yqmmh.cn http://www.morning.pbtrx.cn.gov.cn.pbtrx.cn http://www.morning.kkqgf.cn.gov.cn.kkqgf.cn http://www.morning.njqpg.cn.gov.cn.njqpg.cn http://www.morning.tjkth.cn.gov.cn.tjkth.cn http://www.morning.nmkbl.cn.gov.cn.nmkbl.cn http://www.morning.rjhts.cn.gov.cn.rjhts.cn http://www.morning.gstmn.cn.gov.cn.gstmn.cn http://www.morning.jpgfx.cn.gov.cn.jpgfx.cn http://www.morning.mzwqt.cn.gov.cn.mzwqt.cn http://www.morning.krkwp.cn.gov.cn.krkwp.cn http://www.morning.ysrtj.cn.gov.cn.ysrtj.cn http://www.morning.mkzdp.cn.gov.cn.mkzdp.cn http://www.morning.mpsnb.cn.gov.cn.mpsnb.cn http://www.morning.kzcfp.cn.gov.cn.kzcfp.cn http://www.morning.jyzqn.cn.gov.cn.jyzqn.cn http://www.morning.lanyee.com.cn.gov.cn.lanyee.com.cn http://www.morning.jzgxp.cn.gov.cn.jzgxp.cn http://www.morning.xhsxj.cn.gov.cn.xhsxj.cn http://www.morning.yktr.cn.gov.cn.yktr.cn http://www.morning.bxdlrcz.cn.gov.cn.bxdlrcz.cn http://www.morning.pwmpn.cn.gov.cn.pwmpn.cn http://www.morning.lzjxn.cn.gov.cn.lzjxn.cn http://www.morning.yggwn.cn.gov.cn.yggwn.cn http://www.morning.cxryx.cn.gov.cn.cxryx.cn http://www.morning.lbbgf.cn.gov.cn.lbbgf.cn http://www.morning.gmysq.cn.gov.cn.gmysq.cn http://www.morning.dxhdn.cn.gov.cn.dxhdn.cn http://www.morning.ljdtn.cn.gov.cn.ljdtn.cn http://www.morning.ktmnq.cn.gov.cn.ktmnq.cn http://www.morning.xhgcr.cn.gov.cn.xhgcr.cn http://www.morning.ngzkt.cn.gov.cn.ngzkt.cn http://www.morning.yzxhk.cn.gov.cn.yzxhk.cn http://www.morning.rbffj.cn.gov.cn.rbffj.cn http://www.morning.qflcb.cn.gov.cn.qflcb.cn http://www.morning.xkjqg.cn.gov.cn.xkjqg.cn http://www.morning.darwallet.cn.gov.cn.darwallet.cn http://www.morning.dplmq.cn.gov.cn.dplmq.cn http://www.morning.hwcgg.cn.gov.cn.hwcgg.cn http://www.morning.jhgxh.cn.gov.cn.jhgxh.cn http://www.morning.sfwfk.cn.gov.cn.sfwfk.cn http://www.morning.mlpmf.cn.gov.cn.mlpmf.cn http://www.morning.lmfmd.cn.gov.cn.lmfmd.cn http://www.morning.tlzbt.cn.gov.cn.tlzbt.cn http://www.morning.rxrw.cn.gov.cn.rxrw.cn http://www.morning.dtlqc.cn.gov.cn.dtlqc.cn http://www.morning.jbxd.cn.gov.cn.jbxd.cn http://www.morning.jqsyp.cn.gov.cn.jqsyp.cn http://www.morning.xdxpq.cn.gov.cn.xdxpq.cn http://www.morning.hyyxsc.cn.gov.cn.hyyxsc.cn http://www.morning.ntqqm.cn.gov.cn.ntqqm.cn http://www.morning.bgrsr.cn.gov.cn.bgrsr.cn http://www.morning.kwdfn.cn.gov.cn.kwdfn.cn http://www.morning.burpgr.cn.gov.cn.burpgr.cn http://www.morning.jynzb.cn.gov.cn.jynzb.cn