add vue transition
This commit is contained in:
@@ -111,19 +111,31 @@ const showSources = ref(true);
|
|||||||
<template>
|
<template>
|
||||||
<div class="box" @click="showSources = !showSources">
|
<div class="box" @click="showSources = !showSources">
|
||||||
<p class="average">1 BTC = <span class="nobr">{{ format(average) }} USD</span></p>
|
<p class="average">1 BTC = <span class="nobr">{{ format(average) }} USD</span></p>
|
||||||
<div v-show="showSources">
|
<Transition>
|
||||||
<p>Data Sources:</p>
|
<div v-show="showSources">
|
||||||
<ul>
|
<p>Data Sources:</p>
|
||||||
<li v-for="(val, i) in dataSources">
|
<ul>
|
||||||
{{ val.name }}: {{ format(prices[i]) }}
|
<li v-for="(val, i) in dataSources">
|
||||||
</li>
|
{{ val.name }}: {{ format(prices[i]) }}
|
||||||
</ul>
|
</li>
|
||||||
<p>Standard Deviation: {{ stdev }}</p>
|
</ul>
|
||||||
</div>
|
<p>Standard Deviation: {{ stdev }}</p>
|
||||||
|
</div>
|
||||||
|
</Transition>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
.v-enter-active,
|
||||||
|
.v-leave-active {
|
||||||
|
transition: opacity 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.v-enter-from,
|
||||||
|
.v-leave-to {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.box {
|
.box {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
@@ -137,7 +149,7 @@ const showSources = ref(true);
|
|||||||
backdrop-filter: blur(2px);
|
backdrop-filter: blur(2px);
|
||||||
|
|
||||||
color: #333;
|
color: #333;
|
||||||
padding: 10px 20px;
|
padding: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.average {
|
.average {
|
||||||
|
|||||||
Reference in New Issue
Block a user