-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
唐道勇
authored and
唐道勇
committed
Oct 25, 2021
1 parent
7f392d9
commit a721310
Showing
2 changed files
with
50 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,63 @@ | ||
<!-- | ||
* @Author: your name | ||
* @Date: 2021-10-15 17:25:57 | ||
* @LastEditTime: 2021-10-15 17:45:55 | ||
* @LastEditTime: 2021-10-20 11:12:25 | ||
* @LastEditors: Please set LastEditors | ||
* @Description: In User Settings Edit | ||
* @FilePath: /vue-scaffold/src/views/Home.vue | ||
--> | ||
<template> | ||
<div class="home"> | ||
<img alt="Vue logo" src="../assets/logo.png" /> | ||
<div :class="{ logo: true, animation: animation }" @click="animationAction" /> | ||
<div :class="{ logo: true, zoom: zoom }" @click="zoomAction" /> | ||
<!-- <img alt="Vue logo" /> --> | ||
<!-- <HelloWorld msg="Welcome to Your Vue.js + TypeScript App" /> --> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
// import Vue from "vue"; | ||
// import Component from "vue-class-component"; | ||
// // import HelloWorld from "@/components/HelloWorld.vue"; // @ is an alias to /src | ||
import { defineComponent } from 'vue' | ||
|
||
// @Component | ||
// export default class Home extends Vue { | ||
|
||
// } | ||
export default defineComponent({ | ||
data() { | ||
return { | ||
animation: false, | ||
zoom: false, | ||
} | ||
}, | ||
methods: { | ||
animationAction() { | ||
this.animation = !this.animation | ||
}, | ||
zoomAction() { | ||
this.zoom = !this.zoom | ||
}, | ||
}, | ||
}) | ||
</script> | ||
|
||
<style lang="scss"> | ||
.logo { | ||
height: 100px; | ||
width: 100px; | ||
background-color: red; | ||
animation-name: spin; | ||
animation-duration: 1000ms; | ||
animation-iteration-count: infinite; | ||
animation-timing-function: linear; | ||
} | ||
.animation { | ||
transform: scale(0.5); | ||
} | ||
.zoom { | ||
zoom: 0.5; | ||
} | ||
@keyframes spin { | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
} | ||
</style> |