index.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <div class="temp-layout" >
  3. <component class="fix-layout" :style="{marginLeft:(split-178)+'px'}" :is="active.isbefore?'ibefore':active.cp" :data='active'/>
  4. </div>
  5. </template>
  6. <script>
  7. import lselect from '@/components/lselect'
  8. import {mapState} from 'vuex'
  9. import iuse from './use'
  10. import iapp from './app'
  11. import ibefore from './before'
  12. import iqa from './qa'
  13. import iproduct from './product'
  14. import data from './config'
  15. export default {
  16. computed: {
  17. ...mapState({
  18. split: state => state.ui.navDivision
  19. })
  20. },
  21. data () {
  22. return {active: ''}
  23. },
  24. watch: {
  25. '$route.params': {
  26. immediate: true,
  27. handler: function (newVal) {
  28. if (newVal.active && newVal.active !== 'all') {
  29. this.active = data[newVal.id][newVal.active]
  30. } else {
  31. this.active = data[newVal.id]
  32. }
  33. }
  34. }
  35. },
  36. components: {lselect, ibefore, iuse, iapp, iproduct, iqa},
  37. mounted () {
  38. }
  39. }
  40. </script>
  41. <style lang="scss" scoped>
  42. .temp-layout{
  43. min-height: 350px;
  44. overflow: hidden;
  45. }
  46. @media screen and (max-width: 1600px) {
  47. .fix-layout{
  48. margin-left: auto!important;
  49. margin-right: auto!important;
  50. max-width: 1050px!important;
  51. }
  52. }
  53. </style>