首页
文章分类
源码资源
技术教程
程序软件
文创娱乐
公告通知
其他页面
友情链接
闲聊灌水
关于我们
发布
登录
注册
找回密码
首页
文章分类
源码资源
技术教程
程序软件
文创娱乐
公告通知
其他页面
友情链接
闲聊灌水
关于我们
登录
注册
找回密码
前端
共16篇
前端
排序
发布
更新
浏览
点赞
评论
echarts 自动适配宽度
echarts 自动适配宽度 一.要有一个防抖函数 /** * 函数防抖 * @param {Function} func 包装的函数 * @param {num} delay 延迟时间 * @param {boolean} immediate 第一次滚动会执行两次 开始滚动和结束滚动的时候 * @return {*} */ export function debounce(func, delay, immediate = false) { let timer const context = this return (...args) => { if (immediate) { func.apply(context, args) immediate = false return } clearTimeout(timer) timer = setTimeout(() => { func.apply(context, args) }, delay) } } 二.直接调用 chart.value = echarts.init(echart.value /* 'macarons' */) onMounted(async() => { await nextTick() window.addEventListener('resize', resizeHandler) }) onUnmounted(() => { if (!chart.value) { return } chart.value.dispose() chart.value = null window.removeEventListener('resize', resizeHandler) }) const resizeHandler = debounce(() => { if (chart.value) { chart.value.resize() } }, 200)
韩昊杰
2年前
0
2
0
uniapp 微信小程序编译 [ project.config.json 文件内容错误] project.config.json: libVersion 字段需为 string
echarts 自动适配宽度 一.要有一个防抖函数 /** * 函数防抖 * @param {Function} func 包装的函数 * @param {num} delay 延迟时间 * @param {boolean} immediate 第一次滚动会执行两次 开始滚动和结束滚动的时候 * @return {*} */ export function debounce(func, delay, immediate = false) { let timer const context = this return (...args) => { if (immediate) { func.apply(context, args) immediate = false return } clearTimeout(timer) timer = setTimeout(() => { func.apply(context, args) }, delay) } } 二.直接调用 chart.value = echarts.init(echart.value /* 'macarons' */) onMounted(async() => { await nextTick() window.addEventListener('resize', resizeHandler) }) onUnmounted(() => { if (!chart.value) { return } chart.value.dispose() chart.value = null window.removeEventListener('resize', resizeHandler) }) const resizeHandler = debounce(() => { if (chart.value) { chart.value.resize() } }, 200)
韩昊杰
2年前
0
1
0
vue3如果使用Router的query传参,接参
echarts 自动适配宽度 一.要有一个防抖函数 /** * 函数防抖 * @param {Function} func 包装的函数 * @param {num} delay 延迟时间 * @param {boolean} immediate 第一次滚动会执行两次 开始滚动和结束滚动的时候 * @return {*} */ export function debounce(func, delay, immediate = false) { let timer const context = this return (...args) => { if (immediate) { func.apply(context, args) immediate = false return } clearTimeout(timer) timer = setTimeout(() => { func.apply(context, args) }, delay) } } 二.直接调用 chart.value = echarts.init(echart.value /* 'macarons' */) onMounted(async() => { await nextTick() window.addEventListener('resize', resizeHandler) }) onUnmounted(() => { if (!chart.value) { return } chart.value.dispose() chart.value = null window.removeEventListener('resize', resizeHandler) }) const resizeHandler = debounce(() => { if (chart.value) { chart.value.resize() } }, 200)
韩昊杰
2年前
0
0
0
使用uniapp的时候使用`scroll-view`标签不出现滚动条
echarts 自动适配宽度 一.要有一个防抖函数 /** * 函数防抖 * @param {Function} func 包装的函数 * @param {num} delay 延迟时间 * @param {boolean} immediate 第一次滚动会执行两次 开始滚动和结束滚动的时候 * @return {*} */ export function debounce(func, delay, immediate = false) { let timer const context = this return (...args) => { if (immediate) { func.apply(context, args) immediate = false return } clearTimeout(timer) timer = setTimeout(() => { func.apply(context, args) }, delay) } } 二.直接调用 chart.value = echarts.init(echart.value /* 'macarons' */) onMounted(async() => { await nextTick() window.addEventListener('resize', resizeHandler) }) onUnmounted(() => { if (!chart.value) { return } chart.value.dispose() chart.value = null window.removeEventListener('resize', resizeHandler) }) const resizeHandler = debounce(() => { if (chart.value) { chart.value.resize() } }, 200)
韩昊杰
3年前
1
3
0
Linux:安装npm
echarts 自动适配宽度 一.要有一个防抖函数 /** * 函数防抖 * @param {Function} func 包装的函数 * @param {num} delay 延迟时间 * @param {boolean} immediate 第一次滚动会执行两次 开始滚动和结束滚动的时候 * @return {*} */ export function debounce(func, delay, immediate = false) { let timer const context = this return (...args) => { if (immediate) { func.apply(context, args) immediate = false return } clearTimeout(timer) timer = setTimeout(() => { func.apply(context, args) }, delay) } } 二.直接调用 chart.value = echarts.init(echart.value /* 'macarons' */) onMounted(async() => { await nextTick() window.addEventListener('resize', resizeHandler) }) onUnmounted(() => { if (!chart.value) { return } chart.value.dispose() chart.value = null window.removeEventListener('resize', resizeHandler) }) const resizeHandler = debounce(() => { if (chart.value) { chart.value.resize() } }, 200)
韩昊杰
4年前
0
1
0
1
2
...
4
下一页
在手机上浏览此页面
退出登录
您好!
确认要退出当前登录吗?
取消
确认退出
我是韩昊杰
一个一直在用心写代码的程序员
必须认同
认同吧