default.vue 1.3 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 ref="rightBar"></right-bar>
  7. </div>
  8. </template>
  9. <script>
  10. import { Header, Footer, RightBar } from '~components/default'
  11. export default {
  12. name: 'app',
  13. components: {
  14. HeaderView: Header,
  15. FooterView: Footer,
  16. RightBar
  17. },
  18. head () {
  19. return {
  20. title: this.title
  21. }
  22. },
  23. created() {
  24. this.$root.$on('add_cart', this.drop)
  25. },
  26. methods: {
  27. drop(el) {
  28. this.$refs.rightBar.drop(el)
  29. }
  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>