2017-09-17 1 views
0

Ich zeige MDC snack-bar wie unten. Ich habe null zu actionText zugewiesen:Uncaught Fehler: Bitte geben Sie Aktionstext mit dem Handler

if(isAnyInputEmpty){ 
    sb.show({ 
     message:'Please don\'t leave '+emptyInput+' empty' 
     ,actionOnBottom:false 
     ,multiline:false 
     ,timeout:2750 
     ,actionText:null // actionText:'' => won't work too 
     ,actionHandler:()=>{console.log('snackbar')} 
    }) 
} 

Aber Ich erhalte diese Fehlermeldung:

root.min.js:11 Uncaught Error: Please provide action text with the handler.

Wie ist es möglich, eine Actiontext für den MDC snackbar NICHT zur Verfügung stellen? Ich beabsichtige, es leer zu lassen.

Antwort

0

muss ich sowohl actionText und actionHandler kommentieren zu können, die Snack-Bar Aktionstaste entfernen, wie here erwähnt:

if(isAnyInputEmpty){ 
    sb.show({ 
     message:'Please don\'t leave '+emptyInput+' empty' 
     ,actionOnBottom:false 
     ,multiline:false 
     ,timeout:2750 
     /*,actionText:'Alright' 
     ,actionHandler:()=>{console.log('snackbar')}*/ 
    }) 
} 
Verwandte Themen