ratiw / vue-table

data table simplify! -- vuetable is a Vue.js component that will automatically request (JSON) data from the server and display them nicely in html table with swappable/extensible pagination component.
MIT License
1.83k stars 303 forks source link

requirejs #154

Open clemsontiger opened 7 years ago

clemsontiger commented 7 years ago

Any chance I could get an example of the setup to use vue-table with requirejs? do I still have to use the components/*.vue files somewhere in my project when doing it this way?

see code here: http://codepen.io/paul/pen/RpMXyG

any help is appreciated.

ratiw commented 7 years ago

@clemsontiger I'm afriad I can't help you on that as I don't use requirejs.

clemsontiger commented 7 years ago

@ratiw, hopefully someone else will give me a hand... we don't have the resources right now to switch from requirejs to webpack...

are the .vue files required for when direct including vue-table.js ? or only when using webpack?

ratiw commented 7 years ago

@clemsontiger No, I don't think so. The direct include of vue-table.js does not require the .vue files as they are all bundled up in the vue-table.js file already. It must be the problem the the vue-table.js file cannot work directly under requirejs.

clemsontiger commented 7 years ago

okay thanks. definitely disappointing as vuejs itself works just fine with requirejs, just not vuetable.

ratiw commented 7 years ago

Sorry, that's the best I can do. Hoping that someone else can help with your problem. Or maybe if you have time to look into its code base and help make it work so that it could benefit those who have to same problem like you as well.

clemsontiger commented 7 years ago

Sure, I'll try and take a look and see if I can make it work with requirejs, though not a lot of experience with that.

clemsontiger commented 7 years ago

Apparently, I was trying to too hard and simply needed to wrap vue-table.js in a define(["vue", "vue-resource"], function(Vue, vueResource, vuetable) { ... }); block. Also had to add Vue.use(vueResource); in vue-table.js

got it fully working based on the semantic ui demo: here's my codepen of it working with requirejs: http://codepen.io/paul/full/RpMXyG/