127ce0a76485b902b7d5c9626eeb13d6fd5c26d1.svn-base 842 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <template>
  2. <component :is="myComponent" ref="detail" />
  3. </template>
  4. <script>
  5. import { mapGetters } from 'vuex'
  6. import groupErrorAnalysis from './group'
  7. import PastureErrorAnalysis from './pasture'
  8. export default {
  9. name: 'ErrorAnalysis',
  10. components: { groupErrorAnalysis, PastureErrorAnalysis },
  11. data() {
  12. return {
  13. myComponent: null
  14. }
  15. },
  16. computed: {
  17. ...mapGetters(['ispastureuse'])
  18. },
  19. mounted() {
  20. this.detailComponent()
  21. },
  22. methods: {
  23. detailComponent() {
  24. if (this.ispastureuse == 0) {
  25. const vue = this
  26. var myComponent = () => import('./pasture/index.vue')
  27. return vue.myComponent = myComponent
  28. } else {
  29. const vue = this
  30. var myComponent = () => import('./group/index.vue')
  31. return vue.myComponent = myComponent
  32. }
  33. }
  34. }
  35. }
  36. </script>