This repository was archived by the owner on Jun 27, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +50
-14
lines changed Expand file tree Collapse file tree 4 files changed +50
-14
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ postcss.config.js
10
10
.prettierrc
11
11
.git
12
12
** /.git /
13
+ ** /node_modules /
13
14
yarn.lock
14
15
/dev
15
16
/docs
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ export default {
52
52
*/
53
53
modules : [ [ '@asigloo/vue-dynamic-forms/nuxt' ] ] ,
54
54
dynamicForms : {
55
- theme : 'materialize ' ,
55
+ theme : 'default ' ,
56
56
} ,
57
57
/*
58
58
** Build configuration
Original file line number Diff line number Diff line change @@ -36,3 +36,39 @@ export {
36
36
...
37
37
}
38
38
```
39
+
40
+ ### Install it as Nuxt.js Module
41
+
42
+ Vue Dynamic Forms provides a [ Nuxt.js] ( https://nuxtjs.org/ ) module for easily importing the library into your Nuxt.js App.
43
+
44
+ Nuxt.js version ` 2.12.2 ` (or greater) is recommended.
45
+
46
+ #### Getting dependencies
47
+
48
+ ``` bash
49
+ yarn add @asigloo/vue-dynamic-forms
50
+
51
+ # or, using NPM
52
+ npm install @asigloo/vue-dynamic-forms
53
+ ```
54
+
55
+ Add ` @asigloo/vue-dynamic-forms/nuxt ` to modules section of your ` nuxt.config.js ` file.
56
+
57
+ ``` javascript
58
+ module .exports = {
59
+ modules: [' @asigloo/vue-dynamic-forms/nuxt' ],
60
+ };
61
+ ```
62
+
63
+ #### Choosing theme
64
+
65
+ You can select directly the theme trough ` dynamicForms ` options like this
66
+
67
+ ``` javascript
68
+ module .exports = {
69
+ modules: [' @asigloo/vue-dynamic-forms/nuxt' ],
70
+ dynamicForms: {
71
+ theme: ' materialize' ,
72
+ },
73
+ };
74
+ ```
Original file line number Diff line number Diff line change @@ -5,19 +5,18 @@ const THEMES = ['default'];
5
5
module . exports = function nuxtDynamicForms ( moduleOptions ) {
6
6
const options = Object . assign ( { } , this . options . dynamicForms , moduleOptions ) ;
7
7
8
- if ( THEMES . includes ( options . theme ) ) {
9
- this . options . css . push (
10
- `@asigloo/vue-dynamic-forms/src/styles/themes/${ options . theme } .scss` ,
11
- ) ;
12
- } else {
13
- this . options . css . push (
14
- `@asigloo/vue-dynamic-forms/src/styles/themes/default.scss` ,
15
- ) ;
16
- console . warn (
17
- `[vue-dynamic-forms warn]: Theme '${ options . theme } ' does not exit yet. \n` +
18
- `Selecting theme 'default'. \n` +
19
- `You can propose it as a new theme by creating a PR here 'https://github.com/alvarosaburido/vue-dynamic-forms/pulls'` ,
20
- ) ;
8
+ if ( options && options . theme !== undefined ) {
9
+ if ( THEMES . includes ( options . theme ) ) {
10
+ this . options . css . push (
11
+ `@asigloo/vue-dynamic-forms/src/styles/themes/${ options . theme } .scss` ,
12
+ ) ;
13
+ } else {
14
+ console . warn (
15
+ `[vue-dynamic-forms warn]: Theme '${ options . theme } ' does not exit yet. \n` +
16
+ `Selecting theme 'default'. \n` +
17
+ `You can propose it as a new theme by creating a PR here 'https://github.com/alvarosaburido/vue-dynamic-forms/pulls'` ,
18
+ ) ;
19
+ }
21
20
}
22
21
// Register plugin
23
22
this . addPlugin ( {
You can’t perform that action at this time.
0 commit comments