PageContent.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <page-layout :desc="desc" :title="title" :link-list="linkList">
  3. <div slot="extra" class="extra-img">
  4. <img :src="extraImage"/>
  5. </div>
  6. <!-- keep-alive -->
  7. <route-view></route-view>
  8. </page-layout>
  9. </template>
  10. <script>
  11. import PageLayout from './PageLayout'
  12. import RouteView from './RouteView'
  13. export default {
  14. name: "PageContent",
  15. components: {
  16. RouteView,
  17. PageLayout
  18. },
  19. data () {
  20. return {
  21. title: '',
  22. desc: '',
  23. linkList: [],
  24. extraImage: ''
  25. }
  26. },
  27. mounted () {
  28. this.getPageHeaderInfo()
  29. },
  30. updated () {
  31. this.getPageHeaderInfo()
  32. },
  33. methods: {
  34. getPageHeaderInfo () {
  35. // eslint-disable-next-line
  36. console.log('route title:', this.$route.meta.title)
  37. this.title = this.$route.meta.title
  38. const content = this.$refs.content
  39. if (content) {
  40. this.desc = content.desc
  41. this.linkList = content.linkList
  42. this.extraImage = content.extraImage
  43. }
  44. }
  45. }
  46. }
  47. </script>
  48. <style lang="scss" scoped>
  49. .extra-img{
  50. margin-top: -60px;
  51. text-align: center;
  52. width: 195px;
  53. img{
  54. width: 100%;
  55. }
  56. }
  57. </style>