refs #441 Add scroll top button in list

This commit is contained in:
AkiraFukushima 2018-07-19 22:05:21 +09:00
parent fff15da061
commit 5f6b26cedd
1 changed files with 17 additions and 0 deletions

View File

@ -9,12 +9,17 @@
</div>
</transition-group>
<div class="loading-card" v-loading="lazyLoading" :element-loading-background="backgroundColor"></div>
<div class="upper" v-show="!heading">
<el-button type="primary" icon="el-icon-arrow-up" @click="upper" circle>
</el-button>
</div>
</div>
</template>
<script>
import { mapState } from 'vuex'
import Toot from '../Cards/Toot'
import scrollTop from '../../../utils/scroll'
export default {
name: 'list',
@ -147,6 +152,12 @@ export default {
} finally {
this.$store.commit('TimelineSpace/changeLoading', false)
}
},
upper () {
scrollTop(
document.getElementById('scrollable'),
0
)
}
}
}
@ -174,5 +185,11 @@ export default {
.loading-card:empty {
height: 0;
}
.upper {
position: fixed;
bottom: 20px;
right: 20px;
}
</style>
<style src="@/assets/timeline-transition.scss"></style>