06 2020 档案

摘要:获取当前时间,转为时间戳比较大小,得出它的天数 /** *获取当前时间 *format=1精确到天 *format=2精确到分 */ function getCurrentDate(format) { var now = new Date(); var year = now.getFullYear( 阅读全文
posted @ 2020-06-22 23:10 不睡 阅读(3460) 评论(0) 推荐(0)
摘要:1、with的使用 Thinkphp可以进行关联操作,数据库中需要用到join连接查询时候,用thinkPHP框架的关联查询可以有效的提高查询效率,下面是常用的关联: (1)hasOne:有一个,A 有一个 B(一对一关联) (2)hasMany:有很多,A 有很多 B(一对多关联) (3)belo 阅读全文
posted @ 2020-06-21 19:57 不睡 阅读(7855) 评论(1) 推荐(0)
摘要:父组件调用子组件的方法 方法一:$children,根据下标获取子组件(不推荐) <!--父组件模板--> <div id="app"> <cpn></cpn> <cpn2></cpn2> <button @click="btn">点击</button> </div> <!--子组件模板--> <t 阅读全文
posted @ 2020-06-12 12:57 不睡 阅读(2666) 评论(0) 推荐(0)
摘要:父组件向子组件传递数据 定义父子组件的模板 <!--父组件模板--> <div id="app"> <!--把父组件的msg和str,传给组件cmsg和cstr--> <cpn :cmsg="msg" :cstr="str"></cpn> </div> <!--子组件模板--> <template 阅读全文
posted @ 2020-06-07 18:58 不睡 阅读(229) 评论(0) 推荐(0)