ahmedsaoud31 / laravel-permission-to-vuejs

Laravel Permission Package To Use it in VueJs
89 stars 28 forks source link

Update README.md #20

Closed boakyezitek closed 2 months ago

boakyezitek commented 4 months ago

Issue: Accessing is and can Methods from laravel-permission-to-vue.js in Vue 3 Setup Script

Problem When trying to access the is and can methods from the laravel-permission-to-vue.js plugin in the Vue 3 setup script, a ReferenceError was encountered. This error occurred because the methods were not being accessed correctly from the global properties.

Error Message

ReferenceError: is is not defined at handleFetchTeam (TopBar.vue:210:5) at TopBar.vue:294:5 at runtime-core.esm-bundler.js:2884:88 at callWithErrorHandling (runtime-core.esm-bundler.js:195:19) at callWithAsyncErrorHandling (runtime-core.esm-bundler.js:202:17) at hook.weh.hook.weh (runtime-core.esm-bundler.js:2864:19) at flushPostFlushCbs (runtime-core.esm-bundler.js:378:40) at flushJobs (runtime-core.esm-bundler.js:416:5)

Solution To resolve this issue, the is and can methods are now accessed using the getCurrentInstance method provided by Vue 3. This ensures that the global properties are correctly referenced within the setup script.

Applejack21 commented 2 months ago

Thanks for this readme guide. 🥳

ahmedsaoud31 commented 2 months ago

Thanks, I update the package and README now you can use it directly in Githubissues.

  • Githubissues is a development platform for aggregating issues.