File tree Expand file tree Collapse file tree 3 files changed +31
-33
lines changed Expand file tree Collapse file tree 3 files changed +31
-33
lines changed Original file line number Diff line number Diff line change @@ -159,7 +159,6 @@ const componentsModule: Module<Options> = function () {
159
159
const templates = [
160
160
'components/index.js' ,
161
161
'components/plugin.js' ,
162
- 'components/utils.js' ,
163
162
'components/readme_md' ,
164
163
'vetur/tags.json'
165
164
]
Original file line number Diff line number Diff line change 1
- import { wrapFunctional } from './utils'
2
-
3
1
< %= options . getComponents ( ) . map ( c => {
4
2
const magicComments = [
5
3
`webpackChunkName: "${ c . chunkName } "` ,
@@ -15,3 +13,34 @@ import { wrapFunctional } from './utils'
15
13
return `export { ${ exp } } from '../${ relativeToBuild ( c . filePath ) } '`
16
14
}
17
15
} ) . join ( '\n' ) % >
16
+
17
+ // nuxt/nuxt.js#8607
18
+ function wrapFunctional ( options ) {
19
+ if ( ! options || ! options . functional ) {
20
+ return options
21
+ }
22
+
23
+ const propKeys = Array . isArray ( options . props ) ? options . props : Object . keys ( options . props || { } )
24
+
25
+ return {
26
+ render ( h ) {
27
+ const attrs = { }
28
+ const props = { }
29
+
30
+ for ( const key in this . $attrs ) {
31
+ if ( propKeys . includes ( key ) ) {
32
+ props [ key ] = this . $attrs [ key ]
33
+ } else {
34
+ attrs [ key ] = this . $attrs [ key ]
35
+ }
36
+ }
37
+
38
+ return h ( options , {
39
+ on : this . $listeners ,
40
+ attrs,
41
+ props,
42
+ scopedSlots : this . $scopedSlots ,
43
+ } , this . $slots . default )
44
+ }
45
+ }
46
+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments