juliandavidmr / vue-frame

Dynamic component for creation of interfaces with iframes
https://www.npmjs.com/package/vue-frame
MIT License
47 stars 9 forks source link

Use with multiple iframe destinations? #12

Closed p0psicles closed 6 years ago

p0psicles commented 6 years ago

Expected Behavior

Have two vue-frame elements that refer to two different iframe elements. Each vue-frame loads in it's configured iframe.

Actual Behavior

First vue-frame loads in first iframe. Seconds stays blank.

Steps to Reproduce the Problem

<vue-frame text="'lala'" url="/url/" frame="iframe1" type="button" class="form-control"></vue-frame>
<vue-frame text="lala" url="/url/" frame="iframe2" type="button" class="form-control" ></vue-frame>

 <iframe id="iframe1"></iframe>
 <iframe id="iframe2"></iframe>
juliandavidmr commented 6 years ago

Hi @p0psicles, could you try the project after uncommenting the following code? here.

The console.log should show different values for the this.frame value

p0psicles commented 6 years ago

Issue was the event wasnt triggered because i had it in a v-btn from vuetify. I used a basic <a> tag. And now its working.

So the v-btn breaks it somehow

juliandavidmr commented 6 years ago

Surely the veautify component (v-btn) runs stopPropagation which means that the event is not transmitted to vue-frame.

p0psicles commented 6 years ago

@juliandavidmr Offtopic but do you know if there is a way of catching an event, for when the iframe has finished loading?

juliandavidmr commented 6 years ago

At the moment it is not possible to do what you say in the current version of the package, but it is a feature you might add in the future. I'll do my best to get that new feature out in the next few days.

p0psicles commented 6 years ago

Ow that would be awesome

p0psicles commented 6 years ago

Do you want me to create a separate feature request?

juliandavidmr commented 6 years ago

I think it's a good idea if you do that. Thanks 😉