default.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <div id="app">
  3. <header-view v-if="!isInFrame"></header-view>
  4. <nuxt/>
  5. <footer-view></footer-view>
  6. <right-bar></right-bar>
  7. </div>
  8. </template>
  9. <script>
  10. import { Header, Footer, RightBar } from '~components/default'
  11. export default {
  12. name: 'app',
  13. data () {
  14. return {
  15. isInFrame: false
  16. }
  17. },
  18. components: {
  19. HeaderView: Header,
  20. FooterView: Footer,
  21. RightBar
  22. },
  23. head () {
  24. return {
  25. title: this.title
  26. }
  27. },
  28. mounted () {
  29. this.isInFrame = self !== top
  30. },
  31. computed: {
  32. title () {
  33. let path = this.$route.path
  34. if (path.startsWith('/help/helpList/')) {
  35. return this.helpTitle.item + '-优软商城'
  36. } else if (path.startsWith('/help/helpDetail')) {
  37. return this.helpDetail.title + '-优软商城'
  38. } else if (path.startsWith('/help')) {
  39. return '帮助中心-优软商城'
  40. } else {
  41. return '【优软商城】IC电子元器件现货采购交易平台商城'
  42. }
  43. },
  44. helpTitle () {
  45. return this.$store.state.help.title.data
  46. },
  47. helpDetail () {
  48. return this.$store.state.help.detail.data
  49. }
  50. }
  51. }
  52. </script>