title: Why is moment js not working in mounted vue component?
body: <p>When I put moment on the method like this:</p>
  
  <pre><code>&lt;template&gt; 
      ...
  &lt;/template&gt;
  &lt;script&gt;
      export default{
          ...
          methods:{
              ...
              add(event){
                  let current = moment()                  
              }
          }
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>and then call the add method, it works without error.</p>
  
  <p>But if I put moment on the mounted like this:</p>
  
  <pre><code>mounted(){
     let currentAt = moment()   
  }
  </code></pre>
  
  <p>it does not work. It returns the following error:</p>
  
  <blockquote>
    <p>[Vue warn]: Error in mounted hook: "ReferenceError: moment is not
    defined"</p>
  </blockquote>
  
  <p>How can I solve this?</p>