-
Notifications
You must be signed in to change notification settings - Fork 915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fix] functional SFC style injection support #797
Conversation
lib/component-normalizer.js
Outdated
if (hook && options.functional && injectStyles) { | ||
// inject styles for functioal component in vue file | ||
const existing = options.render | ||
options.render = function renderWithStyleInjection (...args) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This piece of code will run in browser without compilation so we need to use ES5
067bd33
to
bea3e64
Compare
@yyx990803 Updated to use es5 |
lib/component-normalizer.js
Outdated
if (hook) { | ||
if (hook && options.functional && injectStyles) { | ||
// inject styles for functioal component in vue file | ||
const existing = options.render |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
is still es6 ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Damn so used to writing ES6 now :D
bea3e64
to
354f063
Compare
Adds support for SFC components that have injectStyles.
Example component:
Also does not apply hook to functional components, without injectStyles. I believe that this is not needed, correct me if i'm wrong.