vue.js - Minimal examples with external .vue component files not working -
i starting snippets in question how use multiple vue components on single page? following example works vue build app.vue, not work if set simplest server , visit index.html.
index.html:
<!doctype html> <html> <head> <title>test</title> <meta charset="utf-8"> <script type="text/javascript" src="jspm_packages/system.js"></script> <script type="text/javascript" src="config.js"></script> </head> <body> <div id="app"></div> <script type="text/javascript"> system.import('app.js'); </script> </body> </html> app.js:
import vue 'vue/dist/vue.js' window.onload = function() { new vue({ el: '#app', render: h => h(app) }) } app.vue:
<template> <qwop></qwop> </template> <script> import qwop 'qwop.vue' export default { components: { 'qwop': qwop } } </script> qwop.vue:
<template> <div>hello</div> </template> through running vue build app.vue, web server launched , can see "hello" in web page. nothing shows if create web server example python -m http.server , visit index.html. wrong index.html , app.js?
Comments
Post a Comment