-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
[Runtime] Component Props #25
Comments
@sxzz |
It's too long, and I haven't had enough time and read it yet... |
Oh, I'm sorry for rushing you, I understand. |
The essence of designing Vapor is: that we need to maximize compatibility with the existing behavior of Vue core.
|
I've probably implemented the basic functionality, so once I refine it a bit more, it seems like I'll be able to submit a PR. Unlike the render function of traditional components, which generates new rawProps and patches them each time, we need to find a way to always get the latest values of the original props. I'll raise a PR soon for a bit of discussion... |
related: #4
Props
I'm going to work on props/emit from now on (I plan to separate them into separate PRs).
Regarding the design, there are already some points that I'm concerned about.
First, let's consider the design of propsOptions.
Based on some comments in previous PRs, I feel that components should be expressed as functions that return
Block
.Now, in order to implement props, we need to store the runtime types, default values, and user-defined props definitions somewhere.
Discussion 1
It is likely that the interface will be defined through defineProps for now, but I'm wondering if we are assuming that users will use Props Option in the Options API format.
Discussion 2
How should we store the options information of user-defined props in the component?
Since this is an internal matter, I think it will be stored in
ComponentInternalInstance
.The problem is how to store it.
Currently, in the compiler,
code like this is planned to be outputted. (Currently, the output is represented as setup or render options, but referring to the interface
Block
in runtime-vapor/render, it seems to be temporary.)And
ComponentInternalInstance
is generated in the form of receivingBlockFn
as follows:So, we need to discuss how to store user-defined props options.
Drafts
define internal
https://github.com/sxzz/vue-simple-props
export internal options
The text was updated successfully, but these errors were encountered: