摘要: (一)使用props传值: <HeadTitle name-data="100"></HeadTitle> props:['nameData'] 父组件传递复合名称数据时使用小写和中划线(-) 组合,子组件接收复合名称数据时使用小驼峰。 (二)路由去 “#” 路由配置: mode:'history' 阅读全文
posted @ 2018-05-23 15:41 YINGYAN 阅读(223) 评论(0) 推荐(0)
摘要: watch:{ total:{ // total:要检测的数据 handler:(val,oldVal)=>{ // handler方法自动执行 }, deep:true // 深度检测(一般用于复合数据的检测) } } 2、第二种 watch:{ total(){ // 直接以要检测的数据作为方法 阅读全文
posted @ 2018-05-23 10:33 YINGYAN 阅读(271) 评论(0) 推荐(0)