123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <template>
- <div class="preview">
- <div class="loader" v-if="!isLoaded">
- <v-progress-circular indeterminate></v-progress-circular>
- </div>
- <NewsArticle v-else :news="newsItem" />
- </div>
- </template>
- <script>
- export default {
- data() {
- return {
- isLoaded: false,
- newsItem: null,
- };
- },
- async mounted() {
- const uuid = this.$route.query.uuid;
- if(uuid) {
- let response = await this.$axios.get(`admin/news/preview/${uuid}`);
- this.newsItem = response.data.data
- }
- else {
- this.newsItem = JSON.parse(window.localStorage.getItem("preview"))
- }
- if (this.newsItem) this.isLoaded = true;
- },
- };
- </script>
- <style lang="less" scoped>
- .loader {
- text-align: center;
- padding: 50px 0;
- }
- </style>>
|