Skip to content

Commit 876ac5d

Browse files
feat: update Quasar Generator doc (#1666)
1 parent 19ab985 commit 876ac5d

File tree

2 files changed

+46
-51
lines changed

2 files changed

+46
-51
lines changed

create-client/quasar.md

Lines changed: 44 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,64 @@
11
# Quasar Framework Generator
22

33
Create a Quasar Framework application using
4-
[quasar-cli](https://quasar.dev/quasar-cli/installation):
4+
[Quasar CLI](https://quasar.dev/start/quasar-cli):
55

66
```console
7-
quasar create my-app
7+
npm i -g @quasar/cli
8+
npm init quasar
89
cd my-app
910
```
1011

12+
It will ask you some questions, you can use these answers:
13+
14+
```console
15+
What would you like to build ? App with Quasar CLI, let's go!
16+
Project folder: my-app
17+
Pick Quasar version: Quasar v2 (Vue 3 | latest and greatest)
18+
Pick script types: Typescript
19+
Pick Quasar App CLI variant: Quasar App CLI with Vite
20+
Package name: my-app
21+
Pick a Vue component style: Composition API with <script setup>
22+
Check the features needed for your project: ESLint / State Management (Pinia) / Vue-i18n
23+
Pick an ESLint Preset: Prettier
24+
```
25+
26+
Install the required dependencies:
27+
28+
```console
29+
npm install dayjs qs @types/qs
30+
```
31+
1132
In the app directory, generate the files for the resource you want:
1233

1334
```console
1435
npm init @api-platform/client https://demo.api-platform.com src/ -- --generator quasar --resource foo
1536
```
1637

1738
Replace the URL by the entrypoint of your Hydra-enabled API.
18-
You can also use an OpenAPI documentation with `-f openapi3`.
39+
You can also use an OpenAPI documentation with `https://demo.api-platform.com/docs.json` and `-f openapi3`.
1940

2041
Omit the resource flag to generate files for all resource types exposed by the API.
2142

22-
The code is ready to be executed! Register the generated routes:
23-
24-
```javascript
25-
// src/router/routes.js
26-
import fooRoutes from '../generated/router/foo';
27-
28-
const routes = [
29-
{
30-
path: '/',
31-
component: () => import('layouts/MyLayout.vue'),
32-
children: [
33-
...fooRoutes
34-
],
35-
```
43+
**Note:** Make sure to follow the result indications of the command to register the routes and the translations.
3644

37-
And add the modules to the store:
45+
Import common translations:
3846

39-
```javascript
40-
// src/store/index.js
41-
// Replace "foo" with the name of the resource type
42-
import foo from '../generated/store/modules/foo/';
47+
```ts
48+
// src/i18n/en-US/index.ts
49+
import common from './common';
4350

44-
export default function(/* { ssrContext } */) {
45-
const Store = new Vuex.Store({
46-
modules: {
47-
foo,
48-
},
51+
export default {
52+
// ...
53+
...common,
54+
}
4955
```
5056

5157
Finally, make sure to update the config:
5258

53-
```javascript
59+
```js
5460
// quasar.conf.js
5561
framework: {
56-
components: [
57-
'QTable',
58-
'QTh',
59-
'QTr',
60-
'QTd',
61-
'QAjaxBar',
62-
'QBreadcrumbs',
63-
'QBreadcrumbsEl',
64-
'QSpace',
65-
'QInput',
66-
'QForm',
67-
'QSelect',
68-
'QMarkupTable',
69-
'QDate',
70-
'QTime',
71-
'QCheckbox',
72-
'QPopupProxy'
73-
74-
// ...
75-
],
76-
directives: [..., 'ClosePopup'],
7762
plugins: ['Notify'],
7863
config: {
7964
// ...
@@ -84,3 +69,13 @@ framework: {
8469
},
8570
},
8671
```
72+
73+
You can launch the server with:
74+
75+
```console
76+
quasar dev
77+
```
78+
79+
Go to `http://localhost:9000/books/` to start using your app.
80+
81+
**Note:** In order to Mercure to work with the demo, you have to use the port 3000.

create-client/vuejs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ cd my-app
1010
Install the required dependencies:
1111

1212
```console
13-
npm install dayjs lodash @types/lodash
13+
npm install dayjs qs @types/qs
1414
```
1515

1616
To generate all the code you need for a given resource run the following command:
@@ -79,4 +79,4 @@ npm run dev
7979

8080
Go to `http://localhost:5173/books/` to start using your app.
8181

82-
**Note:** In order to Mercure to work, you have to use the port 3000.
82+
**Note:** In order to Mercure to work with the demo, you have to use the port 3000.

0 commit comments

Comments
 (0)