We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c69b9e7 commit 4648323Copy full SHA for 4648323
src/generate.js
@@ -1,6 +1,5 @@
1
-import faker from 'faker'
2
-
3
-export function generate (count) {
+export async function generate (count) {
+ const faker = (await import(/* webpackChunkName: 'faker' */ 'faker')).default
4
const items = []
5
for (let i = 0; i < count; i++) {
6
// const posts = []
src/store.js
@@ -54,8 +54,8 @@ const store = new Vuex.Store({
54
},
55
56
actions: {
57
- generateItems ({ commit }, count) {
58
- items = generate(count)
+ async generateItems ({ commit }, count) {
+ items = await generate(count)
59
commit('generatedCount', count)
60
61
0 commit comments