Skip to content
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

Mixins don't apply render() function #1630

Closed
yusufkandemir opened this issue Jul 19, 2020 · 2 comments
Closed

Mixins don't apply render() function #1630

yusufkandemir opened this issue Jul 19, 2020 · 2 comments

Comments

@yusufkandemir
Copy link

Version

3.0.0-rc.1

Reproduction link

https://codepen.io/yusufkandemir/pen/QWyJVaR

Steps to reproduce

Run the reproduction app, then confirm nothing is rendered and see the warning on the console.

What is expected?

A div that contains the text Test to be rendered. Also, no warnings should be on the console.

What is actually happening?

Nothing is rendered and there is a warning on the console that indicates there is no render function. Mixin has render() but it can't make it into the actual component somehow.


I have noticed this while migrating a Vue 2 app. I couldn't see a mention of this behavior in vuejs/vue-next, vuejs/rfcs, vuejs/docs-next and vuejs/vue-codemod, so I am guessing that this is either a bug or undocumented behavior.

@yyx990803
Copy link
Member

Hmm, just curious, what's your use case for putting render in a mixin?

@yusufkandemir
Copy link
Author

I was migrating a library not an app btw, I guess it can made some difference in context.

We have a field component that has basic functionality, different design options, validation mechanics, etc. This component obviously has render function because it can be used standalone, and is extensible through either by wrapping it in a larger component that consumes it or extending it by using it as a mixin.

We also have some other more opinionated and feature-rich components like input, select, etc. which extends that field component by using it as a mixin along with other things. Field component/mixin has also some hooks like preRender and postRender which can help to modify the rendering behavior.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants