Skip to content

Commit c5ddb8b

Browse files
wip: restore example for v0.7.x
1 parent da8ba02 commit c5ddb8b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,21 @@ Load .vue files dynamically at runtime from your html/js. No node.js environment
3535
vue: Vue
3636
},
3737
async getFile(url) {
38+
39+
// v0.7.x
40+
const res = await fetch(url);
41+
if ( !res.ok )
42+
throw Object.assign(new Error(res.statusText + ' ' + url), { res });
43+
return await res.text();
3844
45+
/* v0.8.x
3946
const res = await fetch(url);
4047
if ( !res.ok )
4148
throw Object.assign(new Error(res.statusText + ' ' + url), { res });
4249
return {
4350
getContentData: asBinary => asBinary ? res.arrayBuffer() : res.text(),
4451
}
52+
*/
4553
},
4654
addStyle(textContent) {
4755

0 commit comments

Comments
 (0)