title: Vue how to solve Uncaught SyntaxError: Function statements require a function name
body: <p>I'm trying to create a simple web app with authentication via Telegram. Telegram has it's own widget with callback which returns you user data after logging in. And the problem is in the script attribute "data-onauth" here you pass the callback you want to execute after success auth. </p>
  
  <p>( <a href="https://core.telegram.org/widgets/login" rel="nofollow noreferrer">https://core.telegram.org/widgets/login</a> - widget documentation if you need it )</p>
  
  <p>To locate log in button in the place you want you just need to paste script given by Telegram's widget generator, but since I can't paste script tag in components template ( vue just won't compile it &amp; just return you error ) I chose to create script element add needed attributes and append it in mounted(). </p>
  
  <p>Here is my component code</p>
  
  <pre><code>&lt;template&gt;
    &lt;header&gt;
        &lt;div class="auth" id="telegramAuth"&gt;
        &lt;/div&gt;
    &lt;/header&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
  export default {
    name: "Header",
    data: () =&gt; ({}),
    mounted() {
      let telegramAuth = document.createElement("script");
      telegramAuth.setAttribute("async", "");
      telegramAuth.setAttribute(
        "src",
        "https://telegram.org/js/telegram-widget.js?7"
      );
  
      telegramAuth.setAttribute("data-userpic", "false");
      telegramAuth.setAttribute("data-telegram-login", "t_adv_bot");
      telegramAuth.setAttribute("data-size", "large");
      telegramAuth.setAttribute("data-onauth", this.loginWithTelegram);
      telegramAuth.setAttribute("data-request-access", "write");
      document.querySelector("#telegramAuth").appendChild(telegramAuth);
    },
    methods: {
      loginWithTelegram: function onTelegramAuth(user) {
          console.log(user);
      }
    }
  };
  &lt;/script&gt;
  </code></pre>
  
  <p>But when I try to do so I get Uncaught SyntaxError: Function statements require a function name.
  And I don't know how to solve it. Thanks in advance and sorry for my poor English</p>