@94ai-plus/nf-resizable-panels
v1.0.0
Published
Vue 3 resizable-panels component for CommonUI Plus
Downloads
1,712
Maintainers
Readme
@94ai-plus/nf-resizable-panels
HomePage
可拖拽分隔面板,支持水平/垂直布局、最小尺寸和本地缓存。
安装
yarn add @94ai-plus/nf-resizable-panels vue element-plusimport { createApp } from 'vue'
import App from './App.vue'
import NfResizablePanels from '@94ai-plus/nf-resizable-panels'
import 'element-plus/dist/index.css'
import '@94ai-plus/nf-resizable-panels/style.css'
const app = createApp(App)
app.use(NfResizablePanels)也可从 @94ai-plus/common-ui 具名导入 NfResizablePanels,或使用 @94ai-plus/common-ui-resolver 自动导入组件和主题样式。
OEM 主题使用 @94ai-plus/nf-theme-oem/nf-resizable-panels.css 替代默认组件样式,不要重复引入两份主题总样式。
示例
以下示例采用总包演示,需安装 @94ai-plus/common-ui;单包使用时按上面的方式导入组件和样式。
<script setup>
import { ref } from 'vue'
import { NfConfigProvider, NfResizablePanels } from '@94ai-plus/common-ui'
const resizes = ref(0)
</script>
<template>
<NfConfigProvider theme="chalk" locale="zh-CN">
<NfResizablePanels cached unique="docs-row" :resize-min-width="80" style="height:160px" @resize="resizes++">
<section style="flex:1">Left</section>
<section style="flex:2">Right</section>
</NfResizablePanels>
<output>resize: {{ resizes }}</output>
</NfConfigProvider>
</template>
<style scoped lang="scss">
.nf-resizable-panels section { padding: 16px; background: var(--el-fill-color-light); }
</style>迁移说明
保留旧版 seperator* 拼写和缓存键 nf-resizable-panels-${unique}。仅恢复数量一致、总尺寸误差不超过 4px 的缓存。方向键调整 10px,Shift+方向键调整 1px;拖拽结束/卸载时清理监听器。
提供 ESM、CJS、browser ES、UMD、声明文件和独立 CSS;浏览器产物仅外置 Vue / Element Plus。 完整属性、事件、插槽和方法见组件文档。
全局默认配置
通过总包的 NfConfigProvider 的 nfResizablePanels 配置项设置默认属性。支持响应式更新和嵌套继承,优先级为组件显式属性 → 最近一层配置 → 外层配置 → 组件原有默认值。undefined 继续继承,false、0 和空字符串保留;按属性合并,数组、对象和函数整体替换,不深度合并。初始化选项仍按组件原有生命周期生效,事件、插槽和原生 attributes 在组件上设置,必填业务数据仍需显式提供。详见全局配置文档。
Contributors
感谢每一位参与项目建设的贡献者!
以上为随本版本发布的贡献者统计快照,统计日期与分支见图中说明;仅统计 Git 非合并提交,头像使用姓名首字母,不是 GitLab 个人照片。
License
本项目采用 MIT License 开源许可。
Copyright (c) 2026-present Jiahe Zou, 94 Intelligent Technology Co., Ltd.
