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

(Question) How can i use modal? #63

Closed
marklofff opened this issue Jan 6, 2017 · 10 comments
Closed

(Question) How can i use modal? #63

marklofff opened this issue Jan 6, 2017 · 10 comments

Comments

@marklofff
Copy link

Hi, How can i use modal?

@ethanclevenger91
Copy link

ethanclevenger91 commented Jan 7, 2017 via email

@jenil
Copy link

jenil commented Jan 7, 2017

I got it to work using the following code:

<template>
<div id="app">
        <b-button @click="toggleModal">
            Click Me!
        </b-button>
    <b-modal ref="modal">
        <div slot="modal-body" class="modal-body">...</div>
    </b-modal>
</div>
</template>

<script>
export default {
    mounted() {
        console.log('welcome!')
    },
    methods: {
        toggleModal() {
            this.$refs.modal.show();
        }
    }
}
</script>

@marklofff
Copy link
Author

@jgog @ethanclevenger91 Thanks a lot!
this project is awesome <3

@riker09
Copy link
Contributor

riker09 commented Jan 23, 2017

@ethanclevenger91 Hello Ethan, do you have any news on the modal implementation? I'm currently fiddling around a bit with Vue + Bootstrap and would like to use the Modal component. What I noticed, is that the CSS class "show" is not set. Instead, a CSS class "in" is set. Hope this helps.

@riker09
Copy link
Contributor

riker09 commented Jan 24, 2017

@ethanclevenger91 I've provided a PR #81 to address this issue. Please have a look.

pi0 added a commit that referenced this issue Jan 24, 2017
Switch CSS class 'in' for 'show', fixes #63
@mosinve
Copy link
Member

mosinve commented Mar 13, 2017

Got worked by changing modal's created method to:

 created() {
        const hub = this.$root;
        hub.$on('show::modal', id => id === this.id && this.show()).bind(this);
        hub.$on('hide::modal', id => id === this.id && this.hide()).bing(this);
    },

and the emitter method of opener:

    openObjects() {
                this.$root.$emit('show::modal', 'modaldlg');
            }

@riker09
Copy link
Contributor

riker09 commented Mar 13, 2017

@mosinve Looks like a typo in the second bind line:

...hide()).bing(this)

probably should be

...hide()).bind(this)

@pi0
Copy link
Member

pi0 commented Mar 13, 2017

Thanks @riker09 for mentioning that. I'm working on modal so it may be my mistake. It will be all better soon :)

@pi0 pi0 reopened this Mar 13, 2017
@mosinve
Copy link
Member

mosinve commented Mar 13, 2017

Yep, thanks @riker09 - it was my typo. In working app all correct and works

@mosinve
Copy link
Member

mosinve commented Mar 14, 2017

Seems, that impossible to use modal in "Option 2: import individual components".

[Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.
(found in at D:\Dev\reestrius_spa\node_modules\bootstrap-vue\components\modal.vue)

@pi0 pi0 closed this as completed Mar 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants