Comments (11)
So I have just published a new version of the repo which I hope will address some of your issues.
I am a bit pressed for time at the moment, but here is an example webpack app I built using the new version. Give me a shout though if you need anything explaining.
https://github.com/BrockReece/vue-fullcalendar-example
from vue-fullcalendar.
Hello,
Maybe I have misunderstood the question but the event handlers in this component are Vue events from Vue 1.x that call the jQuery events on fullcallendar. They can be triggered from the parent component with:
this.$broadcast('event-name')
BTW, The $(this.$el)
jQuery selector will only ever work inside its own component
I hope this helps?
Brock
from vue-fullcalendar.
Cool, So I have just moved to Vue 2 myself and I am still trying to figure out the best way to handle the events too.
I think I am going to build a standalone Vue2 application this morning and try out a few different things and then I will get back to you.
You definitely have the correct fullcalendar event btw, I have built something similar in Vue 1 in the past and that worked for me.
from vue-fullcalendar.
Ah ok sorry, that was the boilerplate readme file.
I used yarn for my package management
https://yarnpkg.com/en/
from vue-fullcalendar.
@BrockReece Thanks.
I'm using Vue 2.0 in my project along with Laravel. I've seen that the broadcast is deprecated in Vue 2.0.
My goal is to have live updates, so every time a new event is created, another call to the server is made (through the 'refetch-events' event) in order to get the list of events again and get it the appear in the view.
The vue-fullcalendar docs says it listens on this Event:
refetch-events() - Makes another JSON call to event sources
Which I think is the most appropriate for my case...
I am already listening to event creation using laravel broadcasting system, Pusher and another Vue component. Every time a new event is created a notification is shown on the screen.
I'm pretty lost trying to make the live updates in my vue-fullcalendar component...
I've seen something about bus events, should I use event hub and $emit?
eventHub.$emit(eventName)
Again, thanks for your response.
from vue-fullcalendar.
@BrockReece, Thank you very much. It will help not only me but other developers too, for sure.
For now I am getting two Unexpected token {
errors and when the page loads, a blank page with Cannot GET / is shown... I've been trying to figure out why. l'll try to figure it out and tell you how I go.
The errors:
ERROR Failed to compile with 2 errors 9:44:23 PM
error in ./~/fullcalendar/dist/fullcalendar.css
Syntax Error: Unexpected token {
@ ./~/vue-style-loader!./~/css-loader?{"minimize":false,"sourceMap":false}!./~/vue-loader/lib/style-compiler?{"id":"data-v-3d91f566","scoped":false,"hasInlineConfig":false}!./~/fullcalendar/dist/fullcalendar.css 4:14-229 13:3-17:5 14:22-237
@ ./~/vue-full-calendar/components/FullCalendar.vue
@ ./~/vue-full-calendar/index.js
@ ./src/main.js
@ multi ./build/dev-client ./src/main.js
error in ./src/App.vue
Syntax Error: Unexpected token {
@ ./~/vue-style-loader!./~/css-loader?{"minimize":false,"sourceMap":false}!./~/vue-loader/lib/style-compiler?{"id":"data-v-2d4b47f2","scoped":false,"hasInlineConfig":false}!./~/vue-loader/lib/selector.js?type=styles&index=0!./src/App.vue 4:14-303 13:3-17:5 14:22-311
@ ./src/App.vue
@ ./src/main.js
@ multi ./build/dev-client ./src/main.js
from vue-fullcalendar.
Have you installed the dependencies?
Do you use yarn?
from vue-fullcalendar.
I've followed the instructions:
npm install
then
npm run dev
from vue-fullcalendar.
Worked like a charm! I'll use it as a basis to implement my project live updates.
from vue-fullcalendar.
Awesome, do you mind if I close this issue?
from vue-fullcalendar.
No, I've managed to get it working by calling the trigger directly from my component. I've had also to include the resources data on computed method to get it working:
mounted() {
const cal = $(this.$el),
self = this;
cal.fullCalendar({
header: this.header,
select(start, end, jsEvent) {
...
var calen = this.calendar;
...
$.fancybox({
type: "iframe",
...
afterClose: function(){
setTimeout(function(){ calen.refetchEvents(); }, 2000);
}
});
}
});
},
computed: {
eventSources() {
const self = this;
return [
{
events(start, end, timezone, callback) {
Vue.http.get('/getAgendamentosEventos', {timezone: timezone}).then(response => {
callback(response.data.events)
})
},
color: '#1ABC9C',
},
{
events(start, end, timezone, callback) {
Vue.http.get('/getDatasFechadas', {timezone: timezone}).then(response => {
callback(response.data.events)
})
},
color: '#DC0000',
}
];
},
},
here's my stackoverflow question which helped me to have the insight:
http://stackoverflow.com/questions/43037140/how-to-refresh-the-vuejs-view-via-event
special thanks for @BrockReece for the support.
My application is up and running now.
from vue-fullcalendar.
Related Issues (20)
- Full Calendar Month View Issue HOT 1
- Problem with a select and v-if in the fullcalendar component
- event.end is null when drap fullDay event drop to agenda. HOT 3
- Time Format
- eventResources doesn't work on calender scheduler
- Title Undefined HOT 11
- Change in class binding breaks rendering HOT 4
- add theme bootstrap
- IE11, npm run dev vue proect Error HOT 2
- An example of using vue-calendar using Rrule
- how to use event-limit
- fullCalendar is not working HOT 7
- Cannot read property 'footprint' of undefined HOT 13
- Component not registering. HOT 2
- Error in callback for watcher "events": "TypeError: jquery__WEBPACK_IMPORTED_MODULE_2___default(...)(...).fullCalendar is not a function #21 HOT 4
- Error in mounted hook: "TypeError: cal.fullCalendar is not a function" HOT 16
- Invalid after ‘daynames’ property is set HOT 2
- Difference in package dependencies HOT 1
- Event not responding the correct way, it stacks on the second day HOT 1
- Can i click on time labels. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-fullcalendar.