import Vue from 'vue'; import ElementUI from 'element-ui'; import 'element-ui/lib/theme-default/index.css'; import App from './app.vue'; import router from './router'; Vue.use(ElementUI); export default function init() { new Vue({ components: { App }, template: '<App/>', el: '#app', router }); }
app.vue
<template> <div id="app"> </div> </template>
html
<body><div id="app"></div></body>