@zhfejs/flexible
v0.0.6
Published
> 大屏适配解决方案脚本
Downloads
3
Readme
@zhfejs/flexible
大屏适配解决方案脚本
npm 安装
npm i @zhfejs/flexible -S引入
在 main.js 中写入以下内容:
import { CssScale } from '@zhfejs/flexible';
new CssScale({scaleControlEl, designWidth, rootEl, limitClientWidth});CDN
<script src="https://unpkg.com/@zhfejs/[email protected]/lib/flexible.umd.js"></script>
<script>
var CssScale = window['@zhfejs/flexible'].CssScale;
new CssScale({scaleControlEl, designWidth, rootEl, limitClientWidth});
</script>CssScale类属性配置说明
| 名称 | 类型 | 默认值 | 必选 | 说明 | | ----------------- | ------------------------------ | ----------- | ---- | ---- | | scaleControlEl | string/HTMLElement | body | 否 | 缩放控制dom节点 | | designWidth | number | 1920 | 否 | 设计稿宽度 | | rootEl | string/HTMLElement | body>div | 否 | 视图dom根节点 | | limitClientWidth | number | undefined | 否 | 缩放最大限制宽度 |
