0ffbf1c783b0dae0901e9ac247839217f6334fd8.svn-base 862 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <template>
  2. <component :is="myComponent" ref="detail" />
  3. </template>
  4. <script>
  5. import { mapGetters } from 'vuex'
  6. import GroupFeedingEfficiency from './group'
  7. import PastureFeedingEfficiency from './pasture'
  8. export default {
  9. name: 'FeedingEfficiency',
  10. components: { GroupFeedingEfficiency, PastureFeedingEfficiency },
  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>