Skip to content
This repository was archived by the owner on Jan 25, 2024. It is now read-only.

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

terraloader
Copy link

@terraloader terraloader commented May 8, 2020

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 terraloader changed the title Added support for data-urls Added support for data-urls, text-scheme and inline SFCs May 8, 2020
@Toilal
Copy link

Toilal commented Feb 26, 2021

@FranckFreiburger Do you plan to merge this pull request ?

@Toilal
Copy link

Toilal commented Feb 26, 2021

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

@Toilal
Copy link

Toilal commented Feb 26, 2021

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

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants