DEV Community

Discussion on: Flask Vue.js Integration Tutorial

Collapse
 
michaelbukachi profile image
Michael Bukachi • Edited

It's the same approach. Here's an example of snippets from index.html and main.js

index.html:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
    <title>web</title>
  </head>
  <body>
    <noscript>
      <strong>We're sorry but web doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
    </noscript>
    <div id="app1"></div>
    <div id="app2"></div>
    <!-- built files will be auto injected -->
  </body>
</html>

main.js:

import Vue from 'vue'
import App1 from './App1.vue'
import App2 from './App2.vue'

Vue.config.productionTip = false

new Vue({
  render: h => h(App1),
}).$mount('#app1')


new Vue({
  render: h => h(App2),
}).$mount('#app2')

Remember to build your vue files otherwise it won't work.