Any examples for vue2-sfc-loader?
See original GitHub issueI can’t seem to figure out how to use the vue2-sfc-loader. If I simply include https://cdn.jsdelivr.net/npm/vue3-sfc-loader/dist/vue2-sfc-loader.js
, nothing seems to get added to the window
object, so code like
const { loadModule } = window['vue3-sfc-loader'];
or
const { loadModule } = window['vue2-sfc-loader'];
just fails. Does the Vue 2 version work different from the Vue 3 version somehow? Unfortunately there are no example for the Vue 2 version, and I really don’t want to dig through the minified source to try and find out how this is supposed to work, so it would be good if you could provide an example of how the Vue 2 version is supposed to be used.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (2 by maintainers)
Top Results From Across the Web
vue2-sfc-loader - npm
Single File Component loader for Vue2. Latest version: 0.8.4, last published: a year ago. Start using vue2-sfc-loader in your project by ...
Read more >Vue Single-File Component (SFC) Spec - Vue Loader
Webpack loader for single-file Vue components.
Read more >vue2-sfc-loader - npm Package Health Analysis - Snyk
Vue3/Vue2 Single File Component loader. Load .vue files dynamically at runtime from your html/js. No node.js environment, no (webpack) build step needed. Key ......
Read more >vue2-sfc-loader 0.8.4 on npm - Libraries.io
Vue3 Single File Component loader. Load .vue files dynamically at runtime from your html/js. No node.js environment, no (webpack) build step ...
Read more >Paul Hammant's Blog: - Buildless SFC VueJS Applications
Vue.JS has a super-cool “Single File Components” (SFC) capability. These are files that contain a component's HTML, JS and CSS.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s as simple as
apparently. Sorry for the issue spam.
You don’t have to wait for the module to be ready though. You can simply specify a function as the component which returns a promise resolving to the component later: https://vuejs.org/v2/guide/components-dynamic-async.html#Async-Components