http-vue-loader icon indicating copy to clipboard operation
http-vue-loader copied to clipboard

Added support for data-urls, text-scheme and inline SFCs

Open terraloader opened this issue 4 years ago • 3 comments

Added support for data-urls:

  • '/index.vue' is not appended to data-urls
  • baseURI is empty to not include a base tag for data-urls

Added support for text-scheme:

  • If URL start with "text:" the function does no XMLHttpRequest but uses the following text direct as SFC content
  • If URL start with "#" its assumed that it is an element id of an inline script element that contains SFC content.

Data-URLs and Text-Method are really useful when you dont want to make extra web requests because you already have the complete content of a vue sfc.

I use this in combination with PHP to pre-include all needed components. This is much more useful than only including a local "text/x-template" because a full vue component SFC can also have scripts and styles.

terraloader avatar May 08 '20 13:05 terraloader

@FranckFreiburger Do you plan to merge this pull request ?

Toilal avatar Feb 26 '21 15:02 Toilal

This could be used to implement a live component editor playground (code on left, rendered component on right).

Toilal avatar Feb 26 '21 15:02 Toilal

Well, now vue3-sfc-loader is there, maybe it makes much sense to make it support vue2 ...

Toilal avatar Feb 26 '21 15:02 Toilal