FullCalendar 自定义按钮图标未显示

All*_*Est 6 javascript jquery fullcalendar

      $('#calendar').fullCalendar({
         header: {
                    left: /*'prev,next'*/'BackwardButton,ForwardButton',
                    center: 'title',
                    right: '',
                },             
                customButtons: {                    
                    ForwardButton: {
                        //text: 'Framåt',
                        click: function () {
                        
                        }
                    },
                    BackwardButton: {
                        //text: 'Bakåt',
                        click: function () {
                         
                            



                        }
                    }
                },
                                buttonsIcons: {
                    BackwardButton: 'left-single-arrow',
                    ForwardButton: 'right-single-arrow',
                },
      
      });
Run Code Online (Sandbox Code Playgroud)
<link href="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.9.0/fullcalendar.css" rel="stylesheet"/>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.0/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.9.0/fullcalendar.js"></script>



<div id="calendar"></div>
Run Code Online (Sandbox Code Playgroud)

我正在使用FullCalender.io。我有两个自定义按钮,我想向其中添加默认的 V 形或箭头。我找到了这些属性,但我不知道应该把它放在完整日历初始化的哪个位置。到目前为止没有任何效果。我只得到文本“未定义”。任何想法任何人?

      jQuery('#calendar').fullCalendar({
            header: {
                left: 'BackwardButton,ForwardButton',
                center: 'title',
                right: '',
            },             
            customButtons: {                    
                ForwardButton: {
                    //text: 'Framåt',
                    click: function () {

                    }
                },
                BackwardButton: {
                    //text: 'Bakåt',
                    click: function () {

                }
            },
            buttonsIcons: {
                BackwardButton: 'left-single-arrow',
                ForwardButton: 'right-single-arrow',
            }
        });
Run Code Online (Sandbox Code Playgroud)

use*_*573 5

编辑:下面的代码有效,但是 OP 的代码是正确的,除非有拼写错误(应该是buttonIcons而不是buttonsIcons)。在此处查看@ADyson 的 JSFiddle:http : //jsfiddle.net/sbxpv25p/510/

原来的:

我认为这可能就是你所追求的:https : //codepen.io/anon/pen/KoLZXq

看起来您试图在错误的位置添加图标:

$("#calendar").fullCalendar({
    header: {
        left: "BackwardButton, ForwardButton",
        center: "title"
    },
    customButtons: {
        ForwardButton: {
            icon: "right-single-arrow",
            click: function() {}
        },
        BackwardButton: {
            icon: "left-single-arrow",
            click: function() {}
        }
    }
})
Run Code Online (Sandbox Code Playgroud)

请注意每个按钮icon现在如何具有一个属性。