mrperfectionist
2 months ago
355
2
Vue

How to make HTML file to VUEjs Components?

Posted 2 months ago by mrperfectionist

I want to convert a HTML file to Vue Components.

<body>

<div id="app">
       <header></header>
 </div>

<script src="vendor/vue.js"></script>
    <script type="text/javascript">
    import Header from 'vendor/Header.vue'
    new Vue({
      el: '#app',
    });

    export default {
      components: {
        Header
      }
    }
</script>
</body>

But giving me an Error:
Uncaught SyntaxError: Cannot use import statement outside a module

Please sign in or create an account to participate in this conversation.