Vue In Browser
Compile and render *.vue component in browser on the fly.
Download
https://unpkg.com/vue-in-browser@1.2.5/dist/bundle.min.js
Why?
Provide way to quick prototyping with vue component. No need to install any dependencies to your project.
In real projects you should use vue-loader
or vueify
instead
Usage
Just include the script on the page and create another inline script to call loadVueComponent(filePath, selector)
.
filePath
is the path (relative or absolute) to your*.vue
fileselector
is the DOM element selector you want to render the vue component on.
Support
Basic template
/ style
/ script
code blocks:
// app.vue {{msg}}
You can import using the src
attribute:
// app-with-import.vue
Javascript support will be based on your browser, so you can write ES2015 if your browser supports, use libraries like @babel/standalone if necessary.
NOTE: importing other components from script doesn't work. However you can call multiple loadVueComponent()
to achieve it.
// container.vue // module-1.vue... // module-2.vue... // html
Scoped CSS, CSS module, mix preprocessor languages not supported yet.