[Vuejs]-Building a vue app with an undefined function

0👍

Add try-catch statement and you’ll good to go. The try-catch will not let the process stop.

getLabel(templateName) {
 try {
   __doPostBack(templateName, "");
 } catch (error) {
   console.log(error)
 }
}

0👍

You could check if __doPostBack exists before trying to run it:

getLabel(templateName) {
  if (__doPostBack) {
    __doPostBack(templateName, "");
  }
}

Leave a comment