You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simon-He95, liushengguang and loweceeavan5 and Nicenonecbliushengguangliushengguangliushengguang and constownwhroe and Simon-He95getanimation, whroe and liushengguangliushengguang and constown
Activity
Kntt commentedon Jul 4, 2019
函数式组件:
createElement函数, 三个参数, 第一个参数是html标签或自定义组件,第二个参数一个obj(包含props, on...等等), 第三个参数children(通过createElement构建, 或者字符串)
censek commentedon Oct 29, 2019
https://juejin.im/post/5b38f4bef265da59bc2cb921
zhangkuibao commentedon Nov 13, 2020
我的理解是:将一个组件的功能抽离出来,只管理状态和数据,这样就可以应对一些功能相似但是布局不同的业务需求。
比如一个
tagList
组件,它的核心功能就是维护一个列表,并且可以添加和删除,把这个核心功能抽离出来作为一个函数式组件,只管理这个列表的添加、删除状态,再暴露一些其他可能用到的数据(如详情列表),然后通过二次封装来实现具体样式。参考:函数式组件在Vue.js中的运用
sc950828 commentedon Sep 23, 2022
functional