Skip to content

Instantly share code, notes, and snippets.

@volgorean
Created December 3, 2017 08:08
Show Gist options
  • Save volgorean/3ed803f26ffc62b886fcc9f093264447 to your computer and use it in GitHub Desktop.
Save volgorean/3ed803f26ffc62b886fcc9f093264447 to your computer and use it in GitHub Desktop.
Example vue.js app setup without webpack
new Vue({
el: "#app",
new Router({
mode: "history",
routes: [
{ path: "/", component: httpVueLoader("components/dash.vue") }
]
})
});
<!DOCTYPE html>
<html>
<head>
<title>whatever you put in head</title>
<link rel="stylesheet" type="text/css" href="css/styles-outside-components-still-work.css">
</head>
<body>
<div id="app">
<router-view></router-view>
</div>
<script src="js/vue.js"></script>
<script src="js/vue-router.js"></script>
<script src="js/vue-http-loader.js"></script>
<script src="js/app.js"></script>
</body>
</html>
@volgorean
Copy link
Author

vue-http-loader being referenced. Note that if you choose to include it then you will need to "serve" your files rather than navigating to the index.html file directly in your browser when developing locally as most browsers will prevent your js requiring the components dynamically otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment