@vc-shell/create-vc-app 2.5.0-pr337.e2e020c → 2.5.0-pr338.ea22f20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ref, type Ref } from "vue";
|
|
2
|
-
import { useAsync,
|
|
2
|
+
import { useAsync, useLoading } from "@vc-shell/framework";
|
|
3
3
|
|
|
4
4
|
export interface <%- ModuleNamePascalCase %>ListQuery {
|
|
5
5
|
keyword?: string;
|
|
@@ -12,28 +12,17 @@ export default function use<%- ModuleNamePascalCase %>List() {
|
|
|
12
12
|
const data: Ref<Record<string, any>[]> = ref([]);
|
|
13
13
|
const totalCount = ref(0);
|
|
14
14
|
|
|
15
|
-
// The list page searches as you type. A slow answer to an earlier keyword can
|
|
16
|
-
// arrive after a newer one, so guard the assignment: whichever request started
|
|
17
|
-
// last is the only one allowed to write.
|
|
18
|
-
const search = useLatestRequest();
|
|
19
|
-
|
|
20
15
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- used by the TODO API call below
|
|
21
16
|
const { loading: itemsLoading, action: getItems } = useAsync<<%- ModuleNamePascalCase %>ListQuery>(async (query) => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
// if (!request.isCurrent()) return; // a newer search superseded this one
|
|
32
|
-
// data.value = result.results ?? [];
|
|
33
|
-
// totalCount.value = result.totalCount ?? 0;
|
|
34
|
-
} finally {
|
|
35
|
-
request.complete();
|
|
36
|
-
}
|
|
17
|
+
// TODO: Replace with real API call
|
|
18
|
+
// const result = await apiClient.search({
|
|
19
|
+
// keyword: query?.keyword,
|
|
20
|
+
// sort: query?.sort,
|
|
21
|
+
// skip: query?.skip ?? 0,
|
|
22
|
+
// take: query?.take ?? 20,
|
|
23
|
+
// });
|
|
24
|
+
// data.value = result.results ?? [];
|
|
25
|
+
// totalCount.value = result.totalCount ?? 0;
|
|
37
26
|
});
|
|
38
27
|
|
|
39
28
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- used by the TODO API call below
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vc-shell/create-vc-app",
|
|
3
3
|
"description": "Application scaffolding",
|
|
4
|
-
"version": "2.5.0-
|
|
4
|
+
"version": "2.5.0-pr338.ea22f20",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": "./dist/index.js",
|
|
7
7
|
"files": [
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@types/ejs": "^3.1.5",
|
|
18
18
|
"@types/prompts": "^2.4.4",
|
|
19
|
-
"@vc-shell/ts-config": "2.5.0-
|
|
19
|
+
"@vc-shell/ts-config": "2.5.0-pr338.ea22f20",
|
|
20
20
|
"copyfiles": "^2.4.1",
|
|
21
21
|
"cross-env": "^7.0.3",
|
|
22
22
|
"shx": "^0.3.4",
|