cannot read property 'id' of undefined select2

前端 未结 2 1631
情歌与酒
情歌与酒 2021-02-02 10:37

I used Select2 4.0.6, I have a bug like below:

allowClear gives \"Uncaught TypeError: Cannot read property \'id\' of undefined\" when used on select.

How can I f

2条回答
  •  生来不讨喜
    2021-02-02 10:43

    If you set the debug property to true you'll see a warning message.

    The allowClear option should be used in combination with the placeholder option.

    
    
    
        
        
    	    
    	
    	
    
    
    	
    
    
    
    

    So you have to define a placeholder as default.

    
    
    
        
        
    	    
    	
    	
    
    
    	
    
    
    
    

提交回复
热议问题