style: 优化代码结构

This commit is contained in:
奔跑的面条 2022-10-31 09:52:02 +08:00
parent 5270fe5246
commit 4e7892632f
3 changed files with 5 additions and 11 deletions

View File

@ -1 +0,0 @@
export type FlipType = 'up' | 'down'

View File

@ -1,4 +1,5 @@
import Flipper from './index.vue'
import { FlipType } from './index.d'
type FlipType = 'up' | 'down'
export { Flipper, FlipType }

View File

@ -1,19 +1,13 @@
<template>
<div class="M-Flipper" :class="[flipType, { go: isFlipping }]">
<div class="go-Flipper" :class="[flipType, { go: isFlipping }]">
<div class="digital front" :data-front="frontTextFromData"></div>
<div class="digital back" :data-back="backTextFromData"></div>
</div>
</template>
<script lang="ts">
export default {
name: 'Flipper'
}
</script>
<script lang="ts" setup>
import { ref, PropType, watch } from 'vue'
import { FlipType } from '.'
import { FlipType } from './index'
const props = defineProps({
flipType: {
@ -131,7 +125,7 @@ $lineColor: #4a9ef8;
}
// #endregion
.M-Flipper {
.go-Flipper {
display: inline-block;
position: relative;
width: $width;