New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Making vue-table work with browserify / webpack #12
Comments
@mozami I actually haven been working on it and have a working example for Semantic UI However, I mainly follow I have been researching if there is any way to programmatically insert child component afterward, but it doesn't seem to be possible. So, I think I have to split the |
Im glad to hear you're already been working on this! Webpack is also a better choice than browserify, so that would be great. I think I understand your problem.... your suggestion of splitting the |
Hello I'm using browserify and I cant get this to work :| |
Any help ? |
@nacr-dev I've never work with browserify before, but if you could show me your |
Ok I will give it a go, gulpfile:
app,js
Clients.vue
Then in the console I get:
Does it help? |
I believe the problem is as @mozami referied in is initial post. vuetable, vuetable-pagination, vuetable-pagination-dropdown have to be in three split .vue files. |
@nacr-dev @mozami After I've made the
How would you include them in your source code with browserify and webpack? |
Well maybe in src\components I am not shore of this. the include part I believe it would be done in my app.js or in my .vue file, like this.
and then refer to it in the components I believe would need to test this. but attention I'm using bootstrap and does components are semantic ready correct? I that case I would not be using douse components. |
well i made a simple test and I believe there is more to it than this. I'm over my head here sorry. |
@nacr-dev This puzzles me a lot since most of the components I've seen has only one file, so it is easy to identify in the webpack.config.js or package.json. I'll keep researching and hopefully find a useful example. The vueify version is coming along quite well. I just don't understand how to release it for those who use browserify and webpack yet. |
ok I will keep a eye on this issue :) 👍 Tks m:8ball: |
@ratiw any Idea when we could test this out? |
@ratiw Perhaps put your work in a separate git branch and we can see and test or contribute to it? Ive been looking around at other components (that use multiple I can try and test with webpack as well. |
@nacr-dev I'm looking at publishing a
@mozami Right now, I've found a way work with
By registering components with Vue instead of declaring them in the |
ah! That would be fantastic :D as soon as it is online I will test it 👍 |
@ratiw - That seems like it might work! Will also give it a test once its up |
@nacr-dev @mozami I've published the beta version of According to the related doc, you will have to pull it in using this command:
You would require it in your var Vue = require('vue')
var VueResource = require('vue-resource')
var Vuetable = require('./components/Vuetable.vue')
var VuetablePaginationBootstrap = require('./components/VuetablePaginationBootstrap.vue')
Vue.use(VueResource)
Vue.component('vuetable', Vuetable)
Vue.component('vuetable-pagination-bootstrap', VuetablePaginationBootstrap)
new Vue({
//...
}) I think it will work but I might be wrong. Please try and let me know how it goes. |
The |
Using this method instead,
|
If you're using
|
@nacr-dev @mozami Ok, got it working as expected! :) Please try it and let me know if there's any problem. |
See https://github.com/ratiw/vuetable-example-vueify-bootstrap If everything is ok, I'll publish v1.0.11 afterward. |
Hello, will use this method npm install git://github.com/ratiw/vue-table#develop --save Will give feedback in minutes! :) |
Hello, It seems I will need to use full path like this,
and I get a error when I run Gulp:
|
Hmmm I get the same for Vuetable.vue
|
@nacr-dev It seems like browserify does not understand |
@nacr-dev Did you setup like this? https://github.com/JeffreyWay/laravel-elixir-vueify |
Hello yes just like that. |
well I changed the code to this:
Same result. |
@nacr-dev Try registering pagination components outside like I did.
Please note the, new Vue({
// ..
ready: function() {
this.$broadcast('vuetable-pagination:setting', 'icons', { prev: 'glyphicon glyphicon-chevron-left', next: 'glyphicon glyphicon-chevron-right'})
}
}) |
Ok, I stand corrected :) |
So at this moment I have no errors: On main js in my case app.js,
And in Clients.vue I implement your sample code and all is working, I still have some stuff to check but no error in console. |
But having to copy the .vue files to a dir in resource dir bugs me ! |
@nacr-dev Same here - im also trying to avoid that route. Playing around with the package now to see if we can do it another way. |
@ratiw is there something missing the check boxes are not working. |
@mozami will wait for you on that one :) |
@nacr-dev unfortunately, havent gotten very far at the moment. I have also encountered the exact same issues as you. Will keep at it for now, and post back later with some updates. |
@nacr-dev The checkboxes are working fine with my example. Please check if you've bound them with May be I'll try an example with browserify if I have time. |
hmmm I simply changed the tableColumns data and the url from your exemple :| |
@ratiw @nacr-dev I think im making some progress with browserify, though it will mean modifications on the package itself. If i get it working properly, Ill upload my work here or send a pull request. |
@mozami 👍 |
I think the problem was quite small in the end. @nacr-dev had gone through most of the issues before me, so I just picked up from where he (or she) left off. @ratiw i have submitted a PR - Adding the browserify transform for vueify helps eliminate the following error that @nacr-dev described above:
All you need to do is add the following to the
This means you do not have to move anything to the resource folder. As for declarations, I am using the same as @nacr-dev and everything seems to work fine:
Although the component can be declared within the Vue instance as well without any problems for me. @ratiw or @nacr-dev Can you confirm if this works for you? |
@mozami Yes, it does work! Browserify can now transform I've already updated the @nacr-dev You could run |
@ratiw Great! Im tied up with some other stuff at the moment, but will test out with webpack later when I get a chance. I wanted to refactor the component structure to have one index.js file that imports in the other ".vue" files, so that you would only need to require one "vuetable" component from your js. This would also require changing the way the pagination works - which is something you've already been through I believe. I ran into template fragmentation issues so put that off on hold:
|
@mozami Yeah, the reason that I have another |
@ratiw OK - I understand your decision. It also makes sense from the end user's point of view and keeping things simple. I'm good with how it is for now :) |
Ok, now I can do It :) fantastic. It Works. |
👍 👍 I guess @ratiw can publish this now. Thanks!! |
Will try to do it tonight. @nacr-dev @mozami Thank you very much for help testing this thing. I'm really learning a lot during the process. :) |
@ratiw thank you for the package it solves a gap I had with vue :) |
Exactly - We should be thanking you here, @ratiw! We're all figuring it out here. I might have some more questions once I begin working with vue properly - is github issues preferred place to do so or just for issues? |
@mozami I think I would prefer you ask question in Laracasts Vue channel or Vue.js Forum. I usually learning something there. For issues, please use github as it is easier for me the track it here. Just tag me, so that I know about it. :) |
@nacr-dev In v1.0.11, you can do use If you use my example code, you can place this code in new Vue({
//...
watch: {
'paginationComponent': function(val, oldVal) {
this.$broadcast('vuetable-pagination:set-options', {
icons: {
prev: 'glyphicon glyphicon-chevron-left',
next: 'glyphicon glyphicon-chevron-right'
},
wrapperClass: 'form-inline',
dropdownClass: 'form-control',
linkClass: 'btn btn-default'
})
}
}
}) So, update to the v1.0.11 and try it out. |
@ratiw noted: will use the forums for Q&A I'll give 1.0.11 a spin tomorrow and report back if there's any issues. |
I've played around with this component and like it so far. Thank you @ratiw!
I tried to use it in a new laravel project (via browserify & using laravel elixir) and noticed it stopped working. Digging around, I see that because of the way it's structured, it wont work with browserify as it is trying to access Vue globally. Are there any plans to restructure it so it can be pulled into a project via
require('vuetable')
statement?Im not an expert at this and still figuring out vue & browserify myself, but I think the component would need to be modularize / split into three
.vue
files:vuetable
,vuetable-pagination
,vuetable-pagination-dropdown
. Each of these will have its ownscript
,style
andtemplate
code.I might try and do this if I get some time and a chance to figure it out. I've added some links below for reference:
http://vuejs.org/guide/application.html#Modularization
https://github.com/vuejs/vueify
http://blog.tighten.co/setting-up-your-first-vuejs-site-using-laravel-elixir-and-vueify
Laracasts:
https://laracasts.com/series/learning-vue-step-by-step/episodes/13
https://laracasts.com/series/painless-builds-with-laravel-elixir/episodes/9
The text was updated successfully, but these errors were encountered: