Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-page-split

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-page-split

基于 Vue2 的面板分割

  • 2.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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>

🔠 属性

属性名类型默认值说明
distributeNumber0.5面板比例,取值范围 0~1
isVerticalBooleantrue切割模式(true:垂直切割,false:水平切割)
lineThicknessNumber6分割线的宽度
hasLineTipBooleantrue分割线中是否有三条杠
backgroundColorString"#a0cfff"分割线的背景颜色
hoverColorString"#409eff"分割线的鼠标hover后的颜色
hasBoxShadowBooleantrue分割线是否有box-shadow样式
firstMinValueNumber0左组件/上组件的最小宽度/高度,必须>=0
secondMinValueNumber0右组件/下组件的最小宽度/高度,必须>=0
isFirstComponentMaskedBooleanfalse左组件/上组件是否需要遮挡层
isSecondComponentMaskedBooleanfalse右组件/下组件是否需要遮挡层

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

🎺 事件

本组件会触发3个事件:

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

📷 效果图

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

动效图1 效果图2

Keywords

FAQs

Package last updated on 14 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc