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

Either source string as input or at least work with data-URIs #39

Open
sp00x opened this issue Apr 13, 2018 · 3 comments
Open

Either source string as input or at least work with data-URIs #39

sp00x opened this issue Apr 13, 2018 · 3 comments

Comments

@sp00x
Copy link

sp00x commented Apr 13, 2018

Would it be possible to get the constructor to take a inline sourced string as input, instead of requiring a URL? (maybe with a base path for any images or whatever the template might refer to)

Alternatively I tried passing the source as a data-uri string, but then I get an error: httpVueLoader.js:453 GET data:text/plain;base64,xxxxxxxxx/index.vue net::ERR_INVALID_URL (apparently it tries to append /index.vue)

@sp00x
Copy link
Author

sp00x commented Apr 13, 2018

(I also tried writing a custom httpVueLoader.httpRequest to intercept data: urls and just return a Promise with the decoded body, but then I run into another issue: 'data' URLs may not be used as base URLs for a document. )

@DimuDesigns
Copy link

DimuDesigns commented Dec 30, 2018

@sp00x There is a function that parses and decomposes the url called parseComponentURL. That's where /index.vue is appended. maybe you can modify it to handle data-uris as well as blob urls.

@terraloader
Copy link

terraloader commented May 8, 2020

I made a pull request to support it: #112
This supports string input, inline element and data-URLs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants