title: Using import from a Vue Component?
body: <p>I have a components.js file that looks like  this:</p>
  
  <pre><code>import { lookCoordinate } from './tools.js'; // I get: SyntaxError: Unexpected token {
  
  Vue.component('coordform', {
    template: `&lt;form id="popup-box" @submit.prevent="process" v-if="visible"&gt;&lt;input type="text" autofocus refs="coordinput" v-model="coords"&gt;&lt;/input&gt;&lt;/form&gt;`,
    data() {
      {
        return { coords: '', visible: false }
      }
    },
    created() {
      window.addEventListener('keydown', this.toggle)
    },
    destroyed() {
      window.removeEventListener('keydown', this.toggle)
    },
    methods: {
      toggle(e) {
        if (e.key == 'g') {
          if (this.visible) {
            this.visible = false;
          } else
            this.visible = true;
        }
      },
      process() {
        lookCoordinate(this.coords) // Tried to import from tools.js
      }
    }
  });
  </code></pre>
  
  <p>But I'm getting:
  <code>Uncaught SyntaxError: Unexpected token {</code></p>
  
  <p>How do I import a function from another plain JS file and use it within a Vue component?</p>
  
  <p>Thanks.</p>