_alias.vue 932 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <template>
  2. <section class="page section">
  3. <div
  4. class="
  5. page__wrapper
  6. detail__wrapper
  7. section-wrapper section-wrapper_extra
  8. "
  9. >
  10. <main class="detail__main">
  11. <div class="detail-main">
  12. <div class="detail-main__wrapper">
  13. <NewsContent :rawHtml="page.data.content"></NewsContent>
  14. </div>
  15. </div>
  16. </main>
  17. <aside class="detail__side">
  18. <WidgetLent></WidgetLent>
  19. </aside>
  20. </div>
  21. </section>
  22. </template>
  23. <script>
  24. import NewsService from '../../services/NewsService'
  25. export default {
  26. methods: {},
  27. async asyncData({ $axios, route, error }) {
  28. const page = await $axios
  29. .get(`https://api.amic.ru/api/v1/page/alias/${route.params.alias}`)
  30. .then((res) => res.data);
  31. if(!page){
  32. error({ statusCode: 404 })
  33. }
  34. return { page };
  35. },
  36. };
  37. </script>
  38. <style lang="less" scoped>
  39. </style>