UNPKG

magic-page-designer

Version:

magic-page-designer 是一个基于 vue 的在线页面快速开发平台,主要把所有的 vue 代码都改为在线配置,最终获得一个 json 格式的页面,你可以把它存放到服务器的任何地方:数据库、静态文件、redis 等。最方便的是可以在线修改页面,再也不用担心生产出问题了,还得打开 IDE,修改测试打包,直接在线编码,所见即所得。还可以配合 [magic-api](https://gitee.com/ssssssss-team/magic-api) 使用,完全抛弃 IDE,随时随地 code w

49 lines (46 loc) 1.21 kB
/** * 滚动条支持的方位 */ export const positionArrays = ['top', 'right', 'bottom', 'left'] /** * 滚动条相关配置 */ export const barConfigs = { // 水平的属性配置 horizontal: { axis: 'X', offset: 'scrollLeft', sizeAttr: 'width', clientAxis: 'clientX', translate: 'translateX', direction1: 'left', direction2: 'right', wheelDelta: 'deltaX' }, // 垂直的属性配置 vertical: { axis: 'Y', offset: 'scrollTop', sizeAttr: 'height', // 滚动条的高度 clientAxis: 'clientY', // 拖动滚动条时,鼠标移动的Y轴坐标值 translate: 'translateY', // 上下移动滚动条的位置 direction1: 'top', // 滚动条容器的top值,会与clientY发生计算 direction2: 'bottom', wheelDelta: 'deltaY' // 在滚动条容器中滚动鼠标滚轮时,滚动量的值 } } /** * 判断postition的方位 * @param {String} position 位置 */ export function verticalOrHorizontal(position: string) { switch (position) { case 'top': case 'bottom': return 'horizontal' case 'left': case 'right': return 'vertical' } return '' }