Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change tab property name for Tab Manager #950

Merged
merged 1 commit into from
Jun 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions src/components/ADempiere/TabManager/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
:name="String(key)"
lazy
:disabled="isDisabledTab(key)"
:style="tabParentStyle"
:style="tabStyle"
>
<lock-record
slot="label"
Expand All @@ -46,7 +46,6 @@
:container-uuid="tabAttributes.uuid"
:panel-metadata="tabAttributes"
:group-tab="tabAttributes.tabGroup"
panel-type="window"
/>
</el-tab-pane>
</template>
Expand Down Expand Up @@ -83,10 +82,10 @@ export default defineComponent({
},

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 tabParentStyle = computed(() => {
const tabStyle = computed(() => {
return {
height: '75vh',
overflow: 'auto'
Expand Down Expand Up @@ -119,8 +118,8 @@ export default defineComponent({
}

// watch router query tab parent value
watch(() => root.$route.query.tabParent, (newValue) => {
if (root.isEmptyValue(newValue) || newValue === 'create-new') {
watch(() => root.$route.query.tab, (newValue) => {
if (root.isEmptyValue(newValue)) {
setTabNumber('0')
return
}
Expand All @@ -133,7 +132,7 @@ export default defineComponent({
root.$router.push({
query: {
...root.$route.query,
tabParent: currentTab.value
tab: currentTab.value
},
params: {
...root.$route.params
Expand All @@ -148,7 +147,7 @@ export default defineComponent({
currentTab,
tabUuid,
// computed
tabParentStyle,
tabStyle,
// meyhods
handleClick,
isDisabledTab
Expand Down