Expected identifier, string or number

前端 未结 4 1849
粉色の甜心
粉色の甜心 2021-01-20 04:10

I have an object like;

var defaults = {
        id: \'ActionSlider\',
        element: \'\',
        closeBtnWidth: 55,
        panelWidth: 320,
        clas         


        
4条回答
  •  旧巷少年郎
    2021-01-20 05:08

    You need to add quotes round the class which is a reserved word. Please also note, that you should remove the last comma:

    var defaults = {
            id: 'ActionSlider',
            element: '',
            closeBtnWidth: 55,
            panelWidth: 320,
            "class": '',
            css: {},
            create: function() {}
        }
    

提交回复
热议问题