摘要: //类式组件的props校验方法 1 <!DOCTYPE html> 2 <html lang="en"> 3 4 <head> 5 <meta charset="UTF-8"> 6 <meta name="viewport" content="width=device-width, initial 阅读全文
posted @ 2021-01-14 20:46 不秃头的代码狗 阅读(242) 评论(0) 推荐(0)
摘要: 1.每个组件对象都会有props 2.每个组件对象的属性都会保存在props中 3.props只读属性不可以直接修改 //函数组件传入props 1 <!DOCTYPE html> 2 <html lang="en"> 3 4 <head> 5 <meta charset="UTF-8"> 6 <m 阅读全文
posted @ 2021-01-14 18:47 不秃头的代码狗 阅读(108) 评论(0) 推荐(0)
摘要: 函数式组件与类式组件 //函数式组件<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0" 阅读全文
posted @ 2021-01-14 17:28 不秃头的代码狗 阅读(129) 评论(0) 推荐(0)