Skip to content

Commit 5647969

Browse files
committed
[feat]:integrated with vuex-module-decorators
1 parent 22a955c commit 5647969

15 files changed

+981
-79
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ yarn add nuxt-property-decorator
3434
### Nuxt JS Instructions
3535
Currently decorators need the following two Babel plugins to work `@babel/plugin-proposal-decorators`,`"@babel/plugin-proposal-class-properties`. Latest Nuxt already adds them for us, the only thing we need is to add `loose` parameter to `@nuxt/babel-preset-app`. Just add this to nuxt-config
3636

37-
~~.
37+
```js
3838
build: {
3939
babel: {
4040
presets({ isServer }) {
@@ -45,18 +45,9 @@ Currently decorators need the following two Babel plugins to work `@babel/plug
4545
]
4646
}
4747
}
48-
}~~ (as there is an issue with @nuxt/babel-preset-app, meanwhile just use the following config)
49-
50-
```js
51-
build: {
52-
babel: {
53-
plugins: [
54-
["@babel/plugin-proposal-decorators", { legacy: true }],
55-
["@babel/plugin-proposal-class-properties", { loose: true }]
56-
]
57-
}
5848
}
5949
```
50+
6051
### Nuxt TS Instructions
6152
It works out of the box with Nuxt TS.
6253

@@ -90,6 +81,15 @@ There are following decorators:
9081
* `@Action`
9182
* `@Mutation`
9283

84+
* **exported from** [`vuex-module-decorators`](https://github.com/championswimmer/vuex-module-decorators)
85+
86+
* Module,
87+
* getModule,
88+
* VuexModule,
89+
* VuexMutation (`Mutation` from original renamed to avoid conflict with 'vuex-class' one),
90+
* MutationAction,
91+
* VuexAction (`Action` from original renamed to avoid conflict with 'vuex-class' one),
92+
9393

9494
### Other exports
9595
* `namespace `

docs/assets/js/search.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/classes/_nuxt_property_decorator_.vuexmodule.html

Lines changed: 500 additions & 0 deletions
Large diffs are not rendered by default.

docs/index.html

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -94,24 +94,15 @@ <h2>Install</h2>
9494
<h3>Nuxt JS Instructions</h3>
9595
</a>
9696
<p>Currently decorators need the following two Babel plugins to work <code>@babel/plugin-proposal-decorators</code>,<code>&quot;@babel/plugin-proposal-class-properties</code>. Latest Nuxt already adds them for us, the only thing we need is to add <code>loose</code> parameter to <code>@nuxt/babel-preset-app</code>. Just add this to nuxt-config</p>
97-
<p><del>.
98-
build: {
99-
babel: {
100-
presets({ isServer }) {
101-
return [
102-
[
103-
&quot;@nuxt/babel-preset-app&quot;, { loose: true }
104-
]
105-
]
106-
}
107-
}
108-
}</del> (as there is an issue with @nuxt/babel-preset-app, meanwhile just use the following config)</p>
10997
<pre><code class="language-js"> build: {
11098
<span class="hljs-attr">babel</span>: {
111-
<span class="hljs-attr">plugins</span>: [
112-
[<span class="hljs-string">"@babel/plugin-proposal-decorators"</span>, { <span class="hljs-attr">legacy</span>: <span class="hljs-literal">true</span> }],
113-
[<span class="hljs-string">"@babel/plugin-proposal-class-properties"</span>, { <span class="hljs-attr">loose</span>: <span class="hljs-literal">true</span> }]
114-
]
99+
presets({ isServer }) {
100+
<span class="hljs-keyword">return</span> [
101+
[
102+
<span class="hljs-string">"@nuxt/babel-preset-app"</span>, { <span class="hljs-attr">loose</span>: <span class="hljs-literal">true</span> }
103+
]
104+
]
105+
}
115106
}
116107
}</code></pre>
117108
<a href="#nuxt-ts-instructions" id="nuxt-ts-instructions" style="color: inherit; text-decoration: none;">
@@ -160,6 +151,16 @@ <h2>Decorators and helpers</h2>
160151
<li><code>@Mutation</code></li>
161152
</ul>
162153
</li>
154+
<li><p><strong>exported from</strong> <a href="https://github.com/championswimmer/vuex-module-decorators"><code>vuex-module-decorators</code></a></p>
155+
<ul>
156+
<li>Module,</li>
157+
<li>getModule,</li>
158+
<li>VuexModule,</li>
159+
<li>VuexMutation (<code>Mutation</code> from original renamed to avoid conflict with &#39;vuex-class&#39; one),</li>
160+
<li>MutationAction,</li>
161+
<li>VuexAction (<code>Action</code> from original renamed to avoid conflict with &#39;vuex-class&#39; one),</li>
162+
</ul>
163+
</li>
163164
</ul>
164165
<a href="#other-exports" id="other-exports" style="color: inherit; text-decoration: none;">
165166
<h3>Other exports</h3>

docs/interfaces/_nuxt_property_decorator_.vue.html

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,9 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</spa
714714
</nav>
715715
<nav class="tsd-navigation secondary menu-sticky">
716716
<ul class="before-current">
717+
<li class=" tsd-kind-class tsd-parent-kind-module tsd-has-type-parameter">
718+
<a href="../classes/_nuxt_property_decorator_.vuexmodule.html" class="tsd-kind-icon">Vuex<wbr>Module</a>
719+
</li>
717720
</ul>
718721
<ul class="current">
719722
<li class="current tsd-kind-interface tsd-parent-kind-module">
@@ -810,13 +813,13 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</spa
810813
<li class=" tsd-kind-type-alias tsd-parent-kind-module">
811814
<a href="../modules/_nuxt_property_decorator_.html#constructor" class="tsd-kind-icon">Constructor</a>
812815
</li>
813-
<li class=" tsd-kind-variable tsd-parent-kind-module">
816+
<li class=" tsd-kind-variable tsd-parent-kind-module tsd-has-type-parameter">
814817
<a href="../modules/_nuxt_property_decorator_.html#action" class="tsd-kind-icon">Action</a>
815818
</li>
816819
<li class=" tsd-kind-variable tsd-parent-kind-module">
817820
<a href="../modules/_nuxt_property_decorator_.html#getter" class="tsd-kind-icon">Getter</a>
818821
</li>
819-
<li class=" tsd-kind-variable tsd-parent-kind-module">
822+
<li class=" tsd-kind-variable tsd-parent-kind-module tsd-has-type-parameter">
820823
<a href="../modules/_nuxt_property_decorator_.html#mutation" class="tsd-kind-icon">Mutation</a>
821824
</li>
822825
<li class=" tsd-kind-variable tsd-parent-kind-module">
@@ -837,6 +840,12 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</spa
837840
<li class=" tsd-kind-function tsd-parent-kind-module">
838841
<a href="../modules/_nuxt_property_decorator_.html#model" class="tsd-kind-icon">Model</a>
839842
</li>
843+
<li class=" tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter">
844+
<a href="../modules/_nuxt_property_decorator_.html#module" class="tsd-kind-icon">Module</a>
845+
</li>
846+
<li class=" tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter">
847+
<a href="../modules/_nuxt_property_decorator_.html#mutationaction" class="tsd-kind-icon">Mutation<wbr>Action</a>
848+
</li>
840849
<li class=" tsd-kind-function tsd-parent-kind-module">
841850
<a href="../modules/_nuxt_property_decorator_.html#nexttick" class="tsd-kind-icon">Next<wbr>Tick</a>
842851
</li>
@@ -867,6 +876,9 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</spa
867876
<li class=" tsd-kind-function tsd-parent-kind-module">
868877
<a href="../modules/_nuxt_property_decorator_.html#watch" class="tsd-kind-icon">Watch</a>
869878
</li>
879+
<li class=" tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter">
880+
<a href="../modules/_nuxt_property_decorator_.html#getmodule" class="tsd-kind-icon">get<wbr>Module</a>
881+
</li>
870882
<li class=" tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter">
871883
<a href="../modules/_nuxt_property_decorator_.html#mixins" class="tsd-kind-icon">mixins</a>
872884
</li>

0 commit comments

Comments
 (0)