最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

vue2實(shí)現(xiàn)簡(jiǎn)易時(shí)鐘效果

 更新時(shí)間:2022年08月30日 11:46:42   作者:蜂巢糖FCT  
這篇文章主要為大家詳細(xì)介紹了vue2實(shí)現(xiàn)簡(jiǎn)易時(shí)鐘效果,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了vue2實(shí)現(xiàn)簡(jiǎn)易時(shí)鐘效果的具體代碼,供大家參考,具體內(nèi)容如下

1.vue2+純css實(shí)現(xiàn)

預(yù)覽效果:

2.代碼如下:

<template>
? ? <div class="main">
? ? ? ? <div class="time">
? ? ? ? ? ? <div class="hour_wrap">
? ? ? ? ? ? ? ? <div class="hour_item" :style="{transform:'translate(-50%,-50%)'+'rotate('+30*(index+1)+'deg)'}" v-for="(item,index) in 12" :key="index">
? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? {{index+1}}
? ? ? ? ? ? ? ? ? ? ?<div class="ke"></div>
? ? ? ? ? ? ? ? </div>
? ? ? ? ? ? </div>
? ? ? ? ? ? <div class="minute_wrap">
? ? ? ? ? ? ? ? <div class="minute_item" :style="{transform:'translate(-50%,-50%)'+'rotate('+6*(index+1)+'deg)'}" v-for="?? ??? ??? ??? ??? ??? ?(item,index) in 60" :key="index">
? ? ? ? ? ? ? ? ? ? ?<div class="ke"></div>
? ? ? ? ? ? ? ? </div>
? ? ? ? ? ? </div>
? ? ? ? ? ? <div class="hour_hand" :style="{transform:'translate(-50%,-100%)'+'rotate('+30*hour+'deg)'}"></div>
? ? ? ? ? ? <div class="minute_hand" :style="{transform:'translate(-50%,-100%)'+'rotate('+6*minute+'deg)'}"></div>
? ? ? ? ? ? <div class="second_hand" :style="{transform:'translate(-50%,-100%)'+'rotate('+6*second+'deg)'}"></div>
? ? ? ? </div>
? ? </div>
</template>
<script>
export default {
? ? data(){
? ? ? ? return{
? ? ? ? ? ? interval:{},
? ? ? ? ? ? date:'',
? ? ? ? ? ? hour:0,
? ? ? ? ? ? minute:0,
? ? ? ? ? ? second:0,

? ? ? ? }
? ? },
? ? mounted(){
? ? ? ? this.interval = setInterval(()=>{
? ? ? ? ? ? this.date = this.getDate();
? ? ? ? ? ? this.hour = this.date.toString().split(' ')[1].split(':')[0];
? ? ? ? ? ? this.minute = this.date.toString().split(' ')[1].split(':')[1];
? ? ? ? ? ? this.second = this.date.toString().split(' ')[1].split(':')[2];
? ? ? ? },1000);
? ? },
? ? beforeDestroy(){
? ? ? ? clearInterval(this.interval);
? ? },
? ? methods:{
? ? ? ?getDate(time,format){
?? ? ? ?var tf = function (i) {
?? ? ? ? ? ?return (i < 10 ? '0' : '') + i
?? ? ? ?};
?? ? ? ?var now = time?new Date(time):new Date();
?? ? ? ?var year = now.getFullYear();
?? ? ? ?var month = now.getMonth() + 1;
?? ? ? ?var date = now.getDate();
?? ? ? ?var hour = now.getHours();
?? ? ? ?var minute = now.getMinutes();
?? ? ? ?var second = now.getSeconds();
?? ? ? ?if(format=='yyyy-mm-dd HH:mm:ss'){
?? ? ? ? ?return year + "-" + tf(month) + "-" + tf(date)+' '+hour+':'+tf(minute)+':'+tf(second);
?? ? ? ?}else{
?? ? ? ? ?return year + "/" + tf(month) + "/" + tf(date)+' '+hour+':'+tf(minute)+':'+tf(second);
?? ? ? ?}
?? ?}
? ? }
}
</script>
<style scoped lang="less">
.time{
? ? border-radius:50%;
? ? width: 140px;
? ? height: 140px;
? ? border: 1px solid #000;
? ? position: relative;
? ? .hour_wrap{
? ? ? ? width: 100%;
? ? ? ? height: 100%;
? ? ? ? position: absolute;
? ? ? ? left: 0;
? ? ? ? top: 0;
? ? ? ? z-index: 3;
? ? ? ? .hour_item{
? ? ? ? ? ? position: absolute;
? ? ? ? ? ? top: 50%;
? ? ? ? ? ? left: 50%;
? ? ? ? ? ? height: 100%;
? ? ? ? ? ? width: 12px;
? ? ? ? ? ? font-size: 12px;
? ? ? ? ? ? text-align: center;
? ? ? ? ? ? transform-origin: 6px 70px;?
? ? ? ? ? ? //transform: translate(-50%,-50%);
? ? ? ? ? ? .ke{
? ? ? ? ? ? ? ? width: 3px;
? ? ? ? ? ? ? ? height: 8px;
? ? ? ? ? ? ? ? background-color: #000;
? ? ? ? ? ? ? ? margin: 0 auto;
? ? ? ? ? ? }
? ? ? ? }
? ? }
? ? .minute_wrap{
? ? ? ? width: 100%;
? ? ? ? height: 100%;
? ? ? ? position: absolute;
? ? ? ? left: 0;
? ? ? ? top: 0;
? ? ? ? z-index: 2;
? ? ? ? .minute_item{
? ? ? ? ? ? position: absolute;
? ? ? ? ? ? top: 50%;
? ? ? ? ? ? left: 50%;
? ? ? ? ? ? height: 100%;
? ? ? ? ? ? width: 10px;
? ? ? ? ? ? font-size: 12px;
? ? ? ? ? ? text-align: center;
? ? ? ? ? ? transform-origin: 5px 70px;?
? ? ? ? ? ? //transform: translate(-50%,-50%);
? ? ? ? ? ? .ke{
? ? ? ? ? ? ? ? width: 2px;
? ? ? ? ? ? ? ? height: 4px;
? ? ? ? ? ? ? ? background-color: #000;
? ? ? ? ? ? ? ? margin: 0 auto;
? ? ? ? ? ? ? ? margin-top: 10px;
? ? ? ? ? ? }
? ? ? ? }
? ? }
? ? .hour_hand{
? ? ? ? width: 3px;
? ? ? ? height: 30px;
? ? ? ? background-color: #000;
? ? ? ? position: absolute;
? ? ? ? top: 50%;
? ? ? ? left: 50%;
? ? ? ? transform-origin: 1.5px 30px;
? ? }
? ? .minute_hand{
? ? ? ? width: 2px;
? ? ? ? height: 50px;
? ? ? ? background-color: #000;
? ? ? ? position: absolute;
? ? ? ? top: 50%;
? ? ? ? left: 50%;
? ? ? ? transform-origin: 1px 50px;
? ? }
? ? .second_hand{
? ? ? ? width: 1px;
? ? ? ? height: 60px;
? ? ? ? background-color: #000;
? ? ? ? position: absolute;
? ? ? ? top: 50%;
? ? ? ? left: 50%;
? ? ? ? transform-origin: 0.5px 60px;
? ? }
}

</style>

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • vue中如何創(chuàng)建多個(gè)ueditor實(shí)例教程

    vue中如何創(chuàng)建多個(gè)ueditor實(shí)例教程

    這篇文章主要給大家介紹了關(guān)于vue中如何創(chuàng)建多個(gè)ueditor的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧。
    2017-11-11
  • Vue項(xiàng)目打包部署到GitHub Pages的實(shí)現(xiàn)步驟

    Vue項(xiàng)目打包部署到GitHub Pages的實(shí)現(xiàn)步驟

    本文主要介紹了Vue項(xiàng)目打包部署到GitHub Pages的實(shí)現(xiàn)步驟,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2022-04-04
  • 詳解Vue如何實(shí)現(xiàn)顏色選擇與調(diào)色板功能

    詳解Vue如何實(shí)現(xiàn)顏色選擇與調(diào)色板功能

    顏色選擇和調(diào)色板是Web開發(fā)中常用的功能,Vue作為一個(gè)流行的JavaScript框架,可以方便地實(shí)現(xiàn)顏色選擇和調(diào)色板功能,本文講講如何在Vue中進(jìn)行顏色選擇和調(diào)色板吧
    2023-06-06
  • vue3之向echarts組件傳值的問題分析

    vue3之向echarts組件傳值的問題分析

    這篇文章主要介紹了vue3之向echarts組件傳值的問題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2024-03-03
  • Vue + element實(shí)現(xiàn)動(dòng)態(tài)顯示后臺(tái)數(shù)據(jù)到options的操作方法

    Vue + element實(shí)現(xiàn)動(dòng)態(tài)顯示后臺(tái)數(shù)據(jù)到options的操作方法

    最近遇到一個(gè)需求需要實(shí)現(xiàn)selector選擇器中選項(xiàng)值options 數(shù)據(jù)的動(dòng)態(tài)顯示,而非寫死的數(shù)據(jù),本文通過實(shí)例代碼給大家分享實(shí)現(xiàn)方法,感興趣的朋友一起看看吧
    2021-07-07
  • vue如何將v-for中的表格導(dǎo)出來

    vue如何將v-for中的表格導(dǎo)出來

    這篇文章主要介紹了vue如何將v-for中的表格導(dǎo)出來,需要的朋友可以參考下
    2018-05-05
  • vue3+electron12+dll開發(fā)客戶端配置詳解

    vue3+electron12+dll開發(fā)客戶端配置詳解

    本文將結(jié)合實(shí)例代碼,介紹vue3+electron12+dll客戶端配置,對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2021-06-06
  • vue使用urlEncode問題

    vue使用urlEncode問題

    這篇文章主要介紹了vue使用urlEncode問題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2024-03-03
  • vue恢復(fù)初始數(shù)據(jù)this.$data,this.$options.data()解析

    vue恢復(fù)初始數(shù)據(jù)this.$data,this.$options.data()解析

    這篇文章主要介紹了vue恢復(fù)初始數(shù)據(jù)this.$data,this.$options.data()解析,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2022-03-03
  • Vue渲染函數(shù)詳解

    Vue渲染函數(shù)詳解

    下面小編就為大家?guī)硪黄猇ue渲染函數(shù)詳解。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2017-09-09

最新評(píng)論

勃利县| 洛浦县| 塘沽区| 乌拉特后旗| 蒲城县| 株洲县| 台州市| 克东县| 米脂县| 夏津县| 鄂温| 西藏| 连城县| 彭州市| 宁陵县| 阳新县| 平邑县| 盘锦市| 昌乐县| 沿河| 元谋县| 大冶市| 尚义县| 涿州市| 融水| 扶风县| 四川省| 焉耆| 留坝县| 七台河市| 丽江市| 云龙县| 清原| 安阳市| 独山县| 镇原县| 南华县| 星座| 开化县| 新化县| 外汇|