Nuxt/examples/custom-loading/components/loading.vue

37 lines
535 B
Vue
Raw Normal View History

2017-07-08 16:49:37 +00:00
<template>
2016-11-11 14:30:11 +00:00
<div class="loading-page" v-if="loading">
<p>Loading...</p>
</div>
</template>
<script>
export default {
data: () => ({
loading: false
}),
methods: {
2017-10-31 13:43:55 +00:00
start() {
2016-11-11 14:30:11 +00:00
this.loading = true
},
2017-10-31 13:43:55 +00:00
finish() {
2016-11-11 14:30:11 +00:00
this.loading = false
}
}
}
</script>
2016-11-19 21:17:57 +00:00
<style scoped>
2016-11-11 14:30:11 +00:00
.loading-page {
position: fixed;
top: 0;
left: 0;
2016-11-19 21:17:57 +00:00
width: 100%;
height: 100%;
background: rgba(255, 255, 255, 0.8);
2016-11-11 14:30:11 +00:00
text-align: center;
2016-11-19 21:17:57 +00:00
padding-top: 200px;
2016-11-11 14:30:11 +00:00
font-size: 30px;
2016-11-19 21:17:57 +00:00
font-family: sans-serif;
2016-11-11 14:30:11 +00:00
}
</style>