Giter Club home page Giter Club logo

Comments (8)

parker-codes avatar parker-codes commented on July 17, 2024 8

It feels abnormal to be using CDNs instead of my regular npm/webpack workflow, but it's for a legacy project that would take too long to get that set up.

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>

<link href='https://unpkg.com/@fullcalendar/[email protected]/main.css' rel='stylesheet' />
<link href='https://unpkg.com/@fullcalendar/[email protected]/main.css' rel='stylesheet' />
<link href='https://unpkg.com/@fullcalendar/[email protected]/main.css' rel='stylesheet' />

<script src='https://unpkg.com/@fullcalendar/[email protected]/main.js'></script>
<script src='https://unpkg.com/@fullcalendar/[email protected]/main.js'></script>
<script src='https://unpkg.com/@fullcalendar/[email protected]/main.js'></script>
<script src='https://unpkg.com/@fullcalendar/[email protected]/main.js'></script>
<script src="https://unpkg.com/@fullcalendar/[email protected]/main.umd.js"></script>

<script>
    document.addEventListener('DOMContentLoaded', function() {

        new Vue({
            el: '#vue-instance',

            data: function() {
                return {
                    plugins: [
                        window.FullCalendarDayGrid.default,
                        window.FullCalendarTimeGrid.default,
                        window.FullCalendarInteraction.default,
                    ],

                    events: [
                        // initial event data
                        {
                            title: "Event Now",
                            start: new Date()
                        }
                    ]
                }
            },

            methods: {
                handleDateClick(arg) {
                    if (confirm("Would you like to add an event to " + arg.dateStr + " ?")) {
                        this.events.push({
                            // add new event data
                            title: "New Event",
                            start: arg.date,
                            allDay: arg.allDay
                        });
                    }
                }
            },

            template: `
            <div>
                <FullCalendar
                    class="app-calendar"
                    defaultView="dayGridMonth"
                    ref="fullCalendar"
                    :header="{
                        left: 'prev,next today',
                        center: 'title',
                        right: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek'
                    }"
                    :plugins="plugins"
                    :weekends="true"
                    :events="events"
                    @dateClick="handleDateClick"
                    />
            </div>
        `,
        });

    });
</script>

from fullcalendar-vue.

arshaw avatar arshaw commented on July 17, 2024 2

The Fullcalendar-Vue connector now publishes a browser-global JS file in dist/main.global.js: https://cdn.jsdelivr.net/npm/@fullcalendar/[email protected]/dist/main.global.min.js

A demo of how to use it: https://github.com/fullcalendar/fullcalendar/blob/master/examples/_global-vue.html

from fullcalendar-vue.

acerix avatar acerix commented on July 17, 2024 1

I tried using the Vue component from script tags and did not get that error but was not able to get it to display either:

https://codepen.io/anon/pen/oRoyYa

I'm not sure it's possible yet; if it is, an example should be added to the docs.

from fullcalendar-vue.

parker-codes avatar parker-codes commented on July 17, 2024

It's working for me. If you're loading the FullCalendar component via the CDN, you don't need to register it in the Vue instance.

from fullcalendar-vue.

waspinator avatar waspinator commented on July 17, 2024

@google-mac can you provide an example?

from fullcalendar-vue.

choikinfat avatar choikinfat commented on July 17, 2024

@google-mac If I want add Bootstrap Theming, how to do that? Thanks

from fullcalendar-vue.

Nix-id avatar Nix-id commented on July 17, 2024

@arshaw

The Fullcalendar-Vue connector now publishes a browser-global JS file in dist/main.global.js: https://cdn.jsdelivr.net/npm/@fullcalendar/[email protected]/dist/main.global.min.js

A demo of how to use it: https://github.com/fullcalendar/fullcalendar/blob/master/examples/_global-vue.html

it's unusable example.

you need somthing like for include

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@fullcalendar/[email protected]/main.global.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@fullcalendar/[email protected]/main.global.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@fullcalendar/[email protected]/main.global.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@fullcalendar/[email protected]/main.global.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@fullcalendar/[email protected]/dist/main.global.min.js"></script>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fullcalendar/[email protected]/main.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fullcalendar/[email protected]/main.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fullcalendar/[email protected]/main.min.css">

but i have one problem with it
<template v-slot:eventContent='arg'>
is not working, but
eventContent: function(arg) {
is working

and there is my question - why are slots not working?

PS: also it is not working if you try use last 3.2 vue

from fullcalendar-vue.

damikael avatar damikael commented on July 17, 2024

Hello @Nix-id I'm facing the same issue, how did you solved it?
Thanks

from fullcalendar-vue.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.