Giter Club home page Giter Club logo

Comments (4)

techouse avatar techouse commented on August 16, 2024 3

Solved my own issue here. I had to use a fat arrow function, like so:

copyWeek:         {
    text: 'Copy week',
    click: () => this.$set(this, "copyDialogVisible", true)
}

Would be nice to have this in the documentation though :)

from fullcalendar-vue.

techouse avatar techouse commented on August 16, 2024 3

It's easy. You need something like this:

<template>
    <div>
        <full-calendar :custom-buttons="customButtons" :header="header" />
    </div>
</template>
 
<script>
    // ... stuff
    data() {
        return {
            header:                            {
                left:   'prev,next today',
                center: 'title',
                right:  'myLink' // this will place the button on the right hand side
            },
            customButtons: {
                myLink: {
                    text: "Take me to your leader",
                    click: () => this.$router.push({name: "yourLeader"}) // assuming you use Vue Router
                }
            }
        }
    }
    // ... more stuff
</script>

P.S. Next time please use SO for questions like these.

from fullcalendar-vue.

ejntaylor avatar ejntaylor commented on August 16, 2024 1

Ok and thanks techouse - will use SO ongoing. Ta

from fullcalendar-vue.

ejntaylor avatar ejntaylor commented on August 16, 2024

I'm trying to create a custom button on my Vue FullCalendar. I just want a button with a link.

Any chance you can give me a pointer.

Currently I have the following:

 <FullCalendar
      :customButtons="customButtons"
      :header="calHeader">

At that point I'm a bit lost at what to do. Something like this in my methods object? But it doesn't work as I know I'm not doing the methods right. Not sure how to format.

Any help appreciated and hope not de-railing original thread too much. Ta

customButtons: function() {
      return {
        custom1: {
          text: "Copy week",
          click: () => alert("clicked the custom button!")
        }
      };
    },
    calHeader() {
      return {
        left: "month,agendaWeek,agendaDay custom1",
        center: "title",
        right: "custom2 prevYear,prev,next,nextYear"
      };
    }

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.