Skip to content

Commit bf25136

Browse files
authored
Merge pull request #836 from apikay/2.4
Add quasar framework docs for generator.
2 parents 28756b4 + 73786ad commit bf25136

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed

client-generator/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ It is able to generate apps using the following frontend stacks:
1111
* [React with Redux](react.md)
1212
* [React Native](react-native.md)
1313
* [Vue.js](vuejs.md)
14+
* [Quasar Framework](quasar.md)
1415

1516
Client Generator works especially well with APIs built with the [API Platform](https://api-platform.com) framework.
1617

client-generator/quasar.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Quasar Framework Generator
2+
3+
Create a Quasar Framework application using
4+
[quasar-cli](https://quasar.dev/quasar-cli/installation):
5+
6+
$ quasar create my-app
7+
$ cd my-app
8+
9+
$ yarn global add @api-platform/client-generator
10+
11+
In the app directory, generate the files for the resource you want:
12+
13+
$ generate-api-platform-client -g quasar https://demo.api-platform.com src/ --resource foo
14+
# Replace the URL by the entrypoint of your Hydra-enabled API
15+
# Omit the resource flag to generate files for all resource types exposed by the API
16+
17+
The code is ready to be executed! Register the generated routes in `src/router/routes.js`
18+
19+
```javascript
20+
import fooRoutes from '../generated/router/foo';
21+
22+
const routes = [
23+
{
24+
path: '/',
25+
component: () => import('layouts/MyLayout.vue'),
26+
children: [
27+
...fooRoutes
28+
],
29+
30+
```
31+
32+
and store modules in the `src/store/index.js` file.
33+
34+
```javascript
35+
// Replace "foo" with the name of the resource type
36+
import foo from '../generated/store/modules/foo/';
37+
38+
export default function(/* { ssrContext } */) {
39+
const Store = new Vuex.Store({
40+
modules: {
41+
foo,
42+
},
43+
44+
```
45+
46+
Make sure to update the `quasar.conf.js` file with the following:
47+
48+
```javascript
49+
framework: {
50+
components: [
51+
'QTable',
52+
'QTh',
53+
'QTr',
54+
'QTd',
55+
'QAjaxBar',
56+
'QBreadcrumbs',
57+
'QBreadcrumbsEl',
58+
'QSpace',
59+
'QInput',
60+
'QForm',
61+
'QSelect',
62+
'QMarkupTable',
63+
'QDate',
64+
'QTime',
65+
'QCheckbox',
66+
'QPopupProxy'
67+
68+
...
69+
],
70+
directives: [..., 'ClosePopup'],
71+
plugins: ['Notify'],
72+
config: {
73+
...
74+
notify: {
75+
position: 'top',
76+
multiLine: true,
77+
timeout: 0,
78+
},
79+
},
80+
```

0 commit comments

Comments
 (0)