看elementui源碼的時候發(fā)現(xiàn)這樣一段代碼: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>);這里為什么可以直接給js變量賦值為一個組件結(jié)構(gòu)呢?再下面結(jié)構(gòu)還可以當做返回值?想請教下這種寫法相關(guān)的知識點?這是js語法還是vue語法?
添加回答
舉報
0/150
提交
取消