Two requests, jump to the same component, operate the same data source, how to make the effect of the tab

I now have two requests, click the link, push to the same vue file, but the request is different, the data source is the same, how to derive two data sources, namely A link, A tab, A data source, B link, B tab, B data source

where A link, A tab, A data source, B link, B tab, B data source, operate on the same vue file.

problem encountered: click the link now to determine whether you need to add a new tab according to the parameters, but open two tabs. If the parameters are different, the contents of the two tabs will be synchronized, so from a business point of view, it is a bug, begging a master to help solve it, or providing an idea.

May.19,2022

Click the corresponding Tab and manipulate the data in the corresponding Tab object, which will not affect other Tab

[
    {
        tabName: 'Tab1',
        tabContent: ''
    },
    {
        tabName: 'Tab2',
        tabContent: ''
    }
]

according to your description, as far as I understand it, the An and B tabs seem to use the same VUE file, so you can extract a common component (component). This common component is loaded in each tab so that there is no data synchronization problem. If not, add an attribute key to the component in the tab. The value is different. I think we can use the timestamp as the value of key.
add: as far as I understand it, a tab is also an VUE file in which you import the common component, and then add key to the tag of the common component.


everything used by A links, A tabs, A data sources is placed in an object such as AData {}, and then B links, B tabs, and B data sources are all placed in BData {}. All values of tab An are this.AData.name (for example), and tab B is the same.

export default {
data(){
    return{
        AData{
            name:'',
            grade:''
        },
        BData{
            name:'',
            grade:''
        }
    }
   }
}
Menu