1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-10 12:01:57 +08:00

Change tab property name for Tab Manager (#950)

This commit is contained in:
Yamel Senih 2021-06-28 19:57:30 -04:00 committed by GitHub
parent 6071dbec8b
commit fb3ae87a3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,7 +31,7 @@
:name="String(key)" :name="String(key)"
lazy lazy
:disabled="isDisabledTab(key)" :disabled="isDisabledTab(key)"
:style="tabParentStyle" :style="tabStyle"
> >
<lock-record <lock-record
slot="label" slot="label"
@ -46,7 +46,6 @@
:container-uuid="tabAttributes.uuid" :container-uuid="tabAttributes.uuid"
:panel-metadata="tabAttributes" :panel-metadata="tabAttributes"
:group-tab="tabAttributes.tabGroup" :group-tab="tabAttributes.tabGroup"
panel-type="window"
/> />
</el-tab-pane> </el-tab-pane>
</template> </template>
@ -83,10 +82,10 @@ export default defineComponent({
}, },
setup(props, { root }) { setup(props, { root }) {
const currentTab = ref(root.$route.query.tabParent) const currentTab = ref(root.$route.query.tab)
const tabUuid = ref(props.tabsList[0].uuid) const tabUuid = ref(props.tabsList[0].uuid)
const tabParentStyle = computed(() => { const tabStyle = computed(() => {
return { return {
height: '75vh', height: '75vh',
overflow: 'auto' overflow: 'auto'
@ -119,8 +118,8 @@ export default defineComponent({
} }
// watch router query tab parent value // watch router query tab parent value
watch(() => root.$route.query.tabParent, (newValue) => { watch(() => root.$route.query.tab, (newValue) => {
if (root.isEmptyValue(newValue) || newValue === 'create-new') { if (root.isEmptyValue(newValue)) {
setTabNumber('0') setTabNumber('0')
return return
} }
@ -133,7 +132,7 @@ export default defineComponent({
root.$router.push({ root.$router.push({
query: { query: {
...root.$route.query, ...root.$route.query,
tabParent: currentTab.value tab: currentTab.value
}, },
params: { params: {
...root.$route.params ...root.$route.params
@ -148,7 +147,7 @@ export default defineComponent({
currentTab, currentTab,
tabUuid, tabUuid,
// computed // computed
tabParentStyle, tabStyle,
// meyhods // meyhods
handleClick, handleClick,
isDisabledTab isDisabledTab