Skip to content

LScaleScreen

组件属性

参数说明类型默认值
width宽度number | string1920
height高度number | string1080
autoScale宽高自适应boolean | {x:boolean,y:boolean}true
delay窗口变化防抖延迟时间number500
fullScreen全屏自适应booleanfalse
boxStyle容器样式objectnull
wrapperStyle自适应区域样式objectnull
bodyOverflowHidden设置 body 为 overflow: hiddenbooleantrue

宽高自适应

自适应配置,配置为boolean类型时,为启动或者关闭自适应;

配置为对象时,若x为true,x 轴产生边距,y为true时,y 轴产生边距,启用fullScreen时此配置失效。

全屏自适应

全屏自适应,启用此配置项时会存在拉伸效果,同时 autoScale 失效,非必要情况下不建议开启。

组件使用

vue
<template>
  <LScaleScreen width="1920" height="1080">
    <div>
      <!-- 自定义内容 -->
    </div>
  </LScaleScreen>
</template>

<script lang="ts">
import { defineComponent } from 'vue';
import { LScaleScreen } from '@vue3-simple-bui/screen';

export default defineComponent({
  name: 'Demo',
  components: {
    LScaleScreen,
  },
});
</script>

基于 MIT 许可发布