kouts / vue-modal

A customizable, stackable, and lightweight modal component for Vue.
https://vue-modal-demo.netlify.app/
MIT License
126 stars 16 forks source link

$listeners and $attrs error in console #8

Open pijlwagen opened 3 years ago

pijlwagen commented 3 years ago

Hi, nice package it looks great!

When using i did come across some issues in the console, everything still seems to be working fine. The errors appear once the modal is shown

[Vue warn]: $listeners is readonly.

found in

---> <VueSimplePortal>
       <VueModal>
         <AddProductWithoutOptions> at resources/js/frontend/components/AddProductWithoutOptions.vue
           <Root>
[Vue warn]: $attrs is readonly.

found in

---> <VueSimplePortal>
       <VueModal>
         <AddProductWithoutOptions> at resources/js/frontend/components/AddProductWithoutOptions.vue
           <Root>

I'm importing the package using webpack (laravel mix)

import VueModal from '@kouts/vue-modal';
Vue.component('Modal', VueModal);

const app = new Vue({
    el: '#app',
});
<button class="btn btn-primary" @click="modal = !modal">Open modal</button>

<modal v-model="modal">

</modal>
kouts commented 3 years ago

Thanks @Michel3951, I haven't seen that error in any of my project. Is it possible that you can you reproduce it somehow in a GitHub repo so that I can take a look?

pijlwagen commented 3 years ago

Hm, I tried to reproduce the error in a new project but was unable to do so. The error only occurs when I'm using npm run watch. I just tried npm run prod and there are no errors in the console so I guess it has something to do with my webpack configuration.

kouts commented 3 years ago

Hey @Michel3951 can you check this issue here https://github.com/LinusBorg/portal-vue/issues/201 configuring an alias of vue in webpack config seems to fix it.

MohamedHana commented 2 years ago

This issue solved here: https://github.com/LinusBorg/portal-vue/issues/201#issuecomment-484525715