前端共16篇
前端
echarts 自动适配宽度-辛达科技-一个只分享技术的站

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-辛达科技-一个只分享技术的站

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传参,接参-辛达科技-一个只分享技术的站

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`标签不出现滚动条-辛达科技-一个只分享技术的站

使用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-辛达科技-一个只分享技术的站

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