ahmedsaoud31 / laravel-permission-to-vuejs

Laravel Permission Package To Use it in VueJs
87 stars 27 forks source link

Missing parts in README.md #16

Closed AlexanderMtchedlidze closed 9 months ago

AlexanderMtchedlidze commented 11 months ago

To set the permission and rules in the correct manner you should implement them in this way:

window.Laravel = { jsPermissions: JSON.parse(permissionsData.value) };

window.Larave because it is initially undefined and window.Laravel.jsPermissions will throw an error if you don't use the approach described above.

Second JSON.parse ensures data, that is in the object is covered in quotes like "rules" and "permissions", to have correct object keys, so they can be accessed correctly in packages index.js file.

ahmedsaoud31 commented 9 months ago

Thanks and sorry for the late reply, this fixed in npm version @3.0.2