when I look at the elementui source code, I find such a code :
const uploadComponent = <upload {...uploadData}>{trigger}</upload>;
return (
<div>
{ this.listType === "picture-card" ? uploadList : ""}
{
this.$slots.trigger
? [uploadComponent, this.$slots.default]
: uploadComponent
}
{this.$slots.tip}
{ this.listType !== "picture-card" ? uploadList : ""}
</div>
);
Why is it possible to directly assign the js variable to a component structure here? Can the following structure be used as a return value for
?
would you like to know something about this way of writing? Is this js grammar or vue syntax?