12345678910111213141516171819202122232425262728293031323334353637 |
- <template>
- <component :is="myComponent" ref="detail" />
- </template>
- <script>
- import { mapGetters } from 'vuex'
- import GroupProcessAnalysis from './group'
- import PastureProcessAnalysis from './pasture'
- export default {
- name: 'ProcessAnalysis',
- components: { GroupProcessAnalysis, PastureProcessAnalysis },
- data() {
- return {
- myComponent: null
- }
- },
- computed: {
- ...mapGetters(['ispastureuse'])
- },
- mounted() {
- this.detailComponent()
- },
- methods: {
- detailComponent() {
- if (this.ispastureuse == 0) {
- const vue = this
- var myComponent = () => import('./pasture/index.vue')
- return vue.myComponent = myComponent
- } else {
- const vue = this
- var myComponent = () => import('./group/index.vue')
- return vue.myComponent = myComponent
- }
- }
- }
- }
- </script>
|