index.vue 804 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <template>
  2. <div class="preview">
  3. <div class="loader" v-if="!isLoaded">
  4. <v-progress-circular indeterminate></v-progress-circular>
  5. </div>
  6. <VideoArticle v-else :videoItem="videoItem" />
  7. </div>
  8. </template>
  9. <script>
  10. export default {
  11. data() {
  12. return {
  13. isLoaded: false,
  14. videoItem: null,
  15. };
  16. },
  17. colorMode: 'dark',
  18. async mounted() {
  19. const uuid = this.$route.query.uuid;
  20. if(uuid) {
  21. let response = await this.$axios.get(`admin/news/preview/${uuid}`);
  22. this.videoItem = response.data.data
  23. }
  24. else {
  25. this.videoItem = JSON.parse(window.localStorage.getItem("preview"))
  26. }
  27. if (this.videoItem) this.isLoaded = true;
  28. },
  29. };
  30. </script>
  31. <style lang="less" scoped>
  32. .loader {
  33. text-align: center;
  34. padding: 50px 0;
  35. }
  36. </style>>