- 博客(8)
- 收藏
- 关注
原创 js递归实现深拷贝
function deepClone(source){ const targetObj = source.constructor === Array ? [] : {}; // 判断复制的目标是数组还是对象 for(let keys in source){ // 遍历目标 if(source.hasOwnProperty(keys)){ if(source[keys] ...
2019-07-26 10:58:36 3528
原创 js日期标准转换格式、日期汉字转换格式
1.日期标准转换格式// 自定义时间格式 :format// "yyyy-MM-dd HH:mm:ss";"yyyy-MM-dd-HH-mm-ss"// "yyyy-MM-ddTHH:mm:ss" ....export function formatDate (time, format) { if (!time) { return '' } if (typeof ti...
2019-07-25 16:22:51 2098
原创 vue axios封装
// axios方法封装import axios from "axios";import qs from "qs"function apiUnit (url, params, method="post") { return new Promise ((resolve, reject) => { let option = { method: method, ...
2019-07-25 16:10:12 89
原创 vue transition 动画
1、html<div id="example"> <button @click="show = !show">Toggle show</button> <transition name="bounce"> <p v-if="show">Lorem ipsum dolor sit amet, consectetur adi...
2019-07-19 11:33:09 109
原创 css实现移动端滚动
height: calc(100% - 50px);overflow-y: auto;-webkit-overflow-scrolling: touch;
2019-07-15 10:00:33 2171
原创 vue移动端处理安卓键盘弹起遮挡
this.focusTimer && clearTimeout(this.focusTimer);this.focusTimer = setTimeout(() => { this.$refs.loginForm.scrollIntoView(true);},200);
2019-07-15 09:11:00 3230 2
转载 vue 深度监听
// 监听某个变量watch: { firstName: { handler(newName, oldName) { this.fullName = newName + ' ' + this.lastName; }, // 代表在wacth里立即执行handler方法 immediate: true }}// 监听对象watch: {...
2019-07-08 15:54:03 845
原创 vue父子组件双向绑定
1、在父组件内部:引用子组件的标签上使用 v-model绑定父组件的某个值(如:v-model=“active”,可以不是value);2、 在子组件内部:// 第一处model: { prop: "value", event: "change" },props: { value: { type: Number, default: 0 }}// 第二...
2019-07-08 15:38:31 164
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人