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

Tab not appearing dynamically #77

Open
NicTorgersen opened this issue Oct 23, 2018 · 0 comments
Open

Tab not appearing dynamically #77

NicTorgersen opened this issue Oct 23, 2018 · 0 comments

Comments

@NicTorgersen
Copy link

NicTorgersen commented Oct 23, 2018

I have a sweet modal with four tabs. One should be hidden unless a specific condition is true, but it isn't appearing in the DOM.

<template>
    <sweet-modal ref="personModal" :title="person.fullName">
        <sweet-modal-tab id="details" title="PersonDeets">
            <person-details :person="person" />
        </sweet-modal-tab>
        <sweet-modal-tab id="status" title="PersonStatus">
            <person-status :person="person" />
        </sweet-modal-tab>
        <sweet-modal-tab v-if="thisConditionShouldBeTrueSometimes" id="extra" title="Extras">
            <extra-person :person="person" />
        </sweet-modal-tab>
        <sweet-modal-tab id="logs" title="Logs">
            <person-logs :person="person" />
        </sweet-modal-tab>
    </sweet-modal>
</template>

<script>
import Vue from 'vue'

export default Vue.extends({
    data() {
        return { 
            person: {},
        }
    },
    computed: {
        thisConditionShouldBeTrueSometimes() { return this.person.hasOwnProperty('someprop') }
    }
})
</script>

thisConditionShouldBeTrueSometimes is a computed property, which just does some checks for some props on the person-object. However, regardless of the return value of this computed property, the tab does not appear.

It exists in the vue-debugger, but is never rendered in the DOM.

I can't disable it, because when the user navigates to another person the modal will open on the disabled tab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant