How do vue single-file components realize dynamic components by merging and inheriting (extend)?

  1. single file component imports subcomponent A B C through import
  2. the child component A B C receives the data passed by the parent component through prop to render the data

question:
when using the dynamic component component is property to switch the display of A B C components according to conditions, how should the subcomponents of import use

in a single file component?

can the imported subcomponents override the properties of the subcomponents to generate new components? Similar to the extend attribute of jquery, and similar to this operation

wrong operation

    import ChartLine from "./component/line.index.vue";
    import ChartMap from "./component/map.index.vue";
    import ChartBar from "./component/bar.index.vue";
    import ChartPie from "./component/pie.index.vue";
    export default {
        components: {
            ChartLine,
            ChartMap,
            ChartBar,
            ChartPie: [ // ChartPie  dataChartPiecomponent
                ChartPie,
                {
                    props: {
                        id: "pies1",
                        series: this.pies1.series
                    }
                }
            ]
        },
        data () {
            return {
                pies1: {
                    series: {
                        data:[
                            {value:535, name: ""},
                            {value:510, name: ""},
                            {value:634, name: ""},
                            {value:735, name: ""}
                        ]
                    },
                    title: {
                    },
                    legend: {

                    }
                }
            };
        },

        
    }

related links:
https://stackoverflow.com/que.

Jun.18,2021

Vue.extend
ide/mixins.html-sharpmain" rel= "nofollow noreferrer" > mixin


render with conditions

Menu