动态组件

html


js

import { TheTable, TheList } from './components'
export default {
    name: 'SystermManager',
    components: {
        ContentContainer,
        RightToLeft,
        TheTable,
        TheList,
    },
    data () {
        return {
            size: true,
            renderSub: true,
        }
    },
    computed: {
        renderSubCom () {
            return this.size === true ? 'TheTable' : 'TheList'
        },
    },
    methods: {
        showChild (e) {
            if (e.target.value === 'table') {
                this.size = true
            } else {
                this.size = false
            }
        },
    },

}

你可能感兴趣的:(动态组件)