1 Star 6 Fork 1

chengbi/vue-page-split

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Vue Page Split

基于 Vue2 的可拖拉缩放的分割面板

Vue3 版

English | 简体中文

🌰 示例

https://chenchengbi.github.io/vue-page-split/#/

📦 安装

$ npm i vue-page-split -S

🔨 使用

在 Vue 项目中使用 PageSplit

<template>
  <PageSplit
    :distribute="0.3"
    :lineThickness="6"
    :isVertical="true"
    @resizeLineStartMove="onresizeLineStartMove"
    @resizeLineMove="onResizeLineMove"
    @resizeLineEndMove="onresizeLineEndMove"
  >
    <template v-slot:first>
      <h1>A</h1>
    </template>
    <template v-slot:second>
      <h1>B</h1>
    </template>
  </PageSplit>
</template>
<script>
import PageSplit from "vue-page-split";

export default {
  components: {
    PageSplit,
  },
  methods: {
    onresizeLineStartMove: function () {
      console.log("onresizeLineStartMove");
    },
    onResizeLineMove: function (e) {
      console.log("onResizeLineMove :>> ", e);
    },
    onresizeLineEndMove: function () {
      console.log("onresizeLineEndMove");
    },
  },
};
</script>

🔠 属性

属性名 类型 默认值 说明
distribute Number 0.5 面板比例,取值范围 0~1
isVertical Boolean true 切割模式(true:垂直切割,false:水平切割)
lineThickness Number 6 分割线的宽度
hasLineTip Boolean true 分割线中是否有三条杠
backgroundColor String "#a0cfff" 分割线的背景颜色
hoverColor String "#409eff" 分割线的鼠标hover后的颜色
hasBoxShadow Boolean true 分割线是否有box-shadow样式
firstMinValue Number 0 左组件/上组件的最小宽度/高度,必须>=0
secondMinValue Number 0 右组件/下组件的最小宽度/高度,必须>=0
isFirstComponentMasked Boolean false 左组件/上组件是否需要遮挡层
isSecondComponentMasked Boolean false 右组件/下组件是否需要遮挡层

备注:遮挡层用于捕获鼠标事件,主要在组件内包含iframe时使用,因为iframe会“吞噬”鼠标事件

🎺 事件

本组件会触发3个事件:

事件名 说明 返回值
resizeLineStartMove 拖拽开始 -
resizeLineMove 拖拽中 event对象
resizeLineEndMove 拖拽结束 -

📷 效果图

如果图片加载不出,请到 Homepage 或 Repository 查看

动效图1 效果图2

MIT License Copyright (c) 2021 chengbi Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

页面分割面板。组件可将页面的一个区域一分为二,而且可以重复嵌套 展开 收起
JavaScript 等 3 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/bi2008/vue-page-split.git
git@gitee.com:bi2008/vue-page-split.git
bi2008
vue-page-split
vue-page-split
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891