We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8e34bad commit 354f063Copy full SHA for 354f063
lib/component-normalizer.js
@@ -61,9 +61,18 @@ module.exports = function normalizeComponent (
61
hook = injectStyles
62
}
63
64
- if (hook) {
+ var existing = options.functional ? options.render : options.beforeCreate
65
+
66
+ if (hook && options.functional && injectStyles) {
67
+ // inject styles for functioal component in vue file
68
+ options.render = function renderWithStyleInjection (h, context) {
69
+ hook(context)
70
+ return existing(h, context)
71
+ }
72
73
74
+ if (hook && !options.functional) {
75
// inject component registration as beforeCreate hook
- var existing = options.beforeCreate
76
options.beforeCreate = existing
77
? [].concat(existing, hook)
78
: [hook]
0 commit comments