Skip to content

Commit 9e24b85

Browse files
wip(docs): enhance examples
1 parent 4666191 commit 9e24b85

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

docs/examples.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ node -e "require('express')().use(require('express').static(__dirname, {index:'i
6363
if ( url === '/main.vue' )
6464
return Promise.resolve(mainComponent);
6565
},
66-
addStyle() {},
66+
addStyle() { /* unused here */ },
6767
}
6868
6969
loadModule('./main.vue', options)
@@ -224,7 +224,7 @@ node -e "require('express')().use(require('express').static(__dirname, {index:'i
224224
if ( url === '/myComponent.vue' )
225225
return Promise.resolve(sfcContent);
226226
},
227-
addStyle() {},
227+
addStyle() { /* unused here */ },
228228
}
229229
230230
const { loadModule } = window['vue3-sfc-loader'];
@@ -321,7 +321,8 @@ ul
321321
const options = {
322322
moduleCache: {
323323
vue: Vue,
324-
stylus: source => Object.assign(stylus(source), { deps: () => [] }), // note: deps() does not work in this bundle of stylus (see https://stylus-lang.com/docs/js.html#deps)
324+
// note: deps() does not work in this bundle of stylus (see https://stylus-lang.com/docs/js.html#deps)
325+
stylus: source => Object.assign(stylus(source), { deps: () => [] }),
325326
},
326327
getFile: () => vueContent,
327328
addStyle(styleStr) {
@@ -470,7 +471,7 @@ _see at [vuejs/rfcs](https://github.com/vuejs/rfcs/pull/231)_
470471
if ( url === '/myComponent.vue' )
471472
return Promise.resolve(sfcContent);
472473
},
473-
addStyle() {},
474+
addStyle() { /* unused here */ },
474475
}
475476
476477
const { loadModule } = window['vue3-sfc-loader'];
@@ -523,7 +524,7 @@ In the following example we use a trick to preserve reactivity through the `Vue.
523524
})[url] || Promise.reject( new Error(res.statusText) );
524525
},
525526
526-
addStyle() { /* ignore styles */ },
527+
addStyle() { /* unused here */ },
527528
}
528529
529530
const { loadModule } = window["vue3-sfc-loader"];
@@ -827,7 +828,8 @@ In the following example we use a trick to preserve reactivity through the `Vue.
827828
addStyle() { /* unused here */ },
828829
}
829830
830-
Vue.createApp(Vue.defineAsyncComponent(() => window['vue3-sfc-loader'].loadModule('/main.vue', options))).mount(document.body);
831+
const { loadModule } = window['vue3-sfc-loader'];
832+
Vue.createApp(Vue.defineAsyncComponent(() => loadModule('/main.vue', options))).mount(document.body);
831833
832834
</script>
833835
</body>

0 commit comments

Comments
 (0)