mercredi 24 mai 2017

vuejs import my own javascript file

I have a php laravel 5.4 project and I wrote a js class for my client-side stuffs.

I'm a newbie in this world, and some questions come up;

  1. How can I import / add my script (CookiesManager.js) (nicely way) to my app.js file and use inside the vue.js environment?
  2. Should I make a module, and if yes how can import it?

Now I try with this in app.js:

import {CookiesManager, cm} from './modules/CookiesManager.js';

But I got an error

[Vue warn]: Error in created hook: "TypeError: __WEBPACK_IMPORTED_MODULE_0__modules_CookiesManager_js__.CookiesManager is undefined"

Thanks the responses in advance.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2qagFqu
via IFTTT

Aucun commentaire:

Enregistrer un commentaire