component_ryl_v3 1.1.6 → 1.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,7 +4,34 @@ This template should help get you started developing with Vue 3 in Vite. The tem
4
4
 
5
5
  Learn more about IDE Support for Vue in the [Vue Docs Scaling up Guide](https://vuejs.org/guide/scaling-up/tooling.html#ide-support).
6
6
 
7
- # 项目功能介绍
7
+ # 组件介绍
8
+
9
+ # 头部组件
10
+ # 使用方法
11
+ <hand-header
12
+ :userInfo="userInfo"
13
+ collapse
14
+ :defaultActive="menuActive"
15
+ :menuList="menuList"
16
+ ref="menuRef"
17
+ >
18
+
19
+ * 组件属性定义
20
+ {Object} userInfo - 用户信息
21
+ {Object} menuList - 导航列表(包含name系统名称和list菜单列表)
22
+ {Object} menuColor - 菜单栏颜色配置(color/activeColor/backgroundColor)
23
+ {string} defaultActive - 默认选中的菜单路径
24
+ {boolean} collapse - 是否启用折叠功能
25
+ {number} width - 侧边栏宽度
26
+ {number} contentWidth - 内容模块宽度
27
+ {boolean} showDefaltOpen - 是否默认展开所有菜单项
28
+ * 暴露方法(通过 ref 调用)
29
+ {Function} getMenu() - 处理传入的导航菜单
30
+ {Function} setMenuActive(path) - 设置菜单选中状态,参数 path 为菜单路径
31
+ {Function} isAddNormal() - 判断是否在 content inner_content 类名上添加 normal 类名
32
+ {Function} loadImg(content) - 等待图片加载完成后获取主容器高度,参数 content 为 HTML 内容
33
+ {Function} getMainHeight(flag) - 获取内容模块的滚动条状态,参数 flag 为是否跳过滚动条置顶
34
+
8
35
 
9
36
  # 询问窗口组件
10
37
  # 使用方法
@@ -95,8 +122,8 @@ Learn more about IDE Support for Vue in the [Vue Docs Scaling up Guide](https://
95
122
  const openPreview = (imageSrc) => {
96
123
  handSeeImgRef.value.openPreview(imageSrc)
97
124
  }
98
- * 组件属性定义
99
- {string} imageSrc - 图片路径
125
+ * 暴露方法(通过 ref 调用)
126
+ {Function} openPreview(imageSrc) - 打开图片预览
100
127
 
101
128
  # Tab组件
102
129
  # 使用方法
@@ -107,6 +134,8 @@ Learn more about IDE Support for Vue in the [Vue Docs Scaling up Guide](https://
107
134
  }
108
135
  * 组件属性定义
109
136
  {array} list - Tab列表,每个元素为{ label: '标签', value: '值' }
137
+ * 暴露方法(通过 ref 调用)
138
+ {Function} setIndex(index) - 设置当前选中的标签索引,参数 index 为要选中的标签索引
110
139
 
111
140
 
112
141
 
@@ -382,6 +382,10 @@ const _sfc_main$4 = {
382
382
  type: Number,
383
383
  default: 180
384
384
  },
385
+ contentWidth: {
386
+ type: Number,
387
+ default: 1200
388
+ },
385
389
  userInfo: {
386
390
  type: Object,
387
391
  default: () => ({})
@@ -402,7 +406,7 @@ const _sfc_main$4 = {
402
406
  const isIE = ref(false);
403
407
  const hideMenu = ref(false);
404
408
  const showFooter = ref(false);
405
- const minWidth = ref(0);
409
+ const minWidth = ref(props.contentWidth);
406
410
  const localDefaultActive = ref(props.defaultActive);
407
411
  const mainRef = ref(null);
408
412
  const completeWidth = computed(() => {
@@ -540,7 +544,7 @@ const _sfc_main$4 = {
540
544
  };
541
545
  onMounted(() => {
542
546
  const windowWidth = window.screen.availWidth;
543
- minWidth.value = windowWidth > 1800 ? 1800 - props.width : windowWidth - props.width;
547
+ minWidth.value = windowWidth > minWidth.value ? minWidth.value - props.width : windowWidth - props.width;
544
548
  browser();
545
549
  nextTick(() => {
546
550
  getMenu();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "component_ryl_v3",
3
3
  "private": false,
4
- "version": "1.1.6",
4
+ "version": "1.1.8",
5
5
  "type": "module",
6
6
  "description": "Vue3 login form component with Element Plus",
7
7
  "main": "./dist/component_ryl_v3.js",
@@ -94,6 +94,7 @@ import sidebarItem from './sidebarItem.vue'
94
94
  * @property {string} defaultActive - 默认选中的菜单路径
95
95
  * @property {boolean} collapse - 是否启用折叠功能
96
96
  * @property {number} width - 侧边栏宽度
97
+ * @property {number} contentWidth - 内容模块宽度
97
98
  * @property {Object} userInfo - 用户信息
98
99
  * @property {boolean} showDefaltOpen - 是否默认展开所有菜单项
99
100
  */
@@ -122,6 +123,10 @@ const props = defineProps({
122
123
  type: Number,
123
124
  default: 180
124
125
  },
126
+ contentWidth: {
127
+ type: Number,
128
+ default: 1200
129
+ },
125
130
  userInfo: {
126
131
  type: Object,
127
132
  default: () => ({})
@@ -147,7 +152,7 @@ const defaultOpen = ref([]) // 默认打开的菜单
147
152
  const isIE = ref(false) // 是否是ie浏览器
148
153
  const hideMenu = ref(false) // 是否隐藏菜单
149
154
  const showFooter = ref(false) // 效果展示优化
150
- const minWidth = ref(0) // 内容模块的默认最小宽度
155
+ const minWidth = ref(props.contentWidth) // 内容模块的默认最小宽度
151
156
  const localDefaultActive = ref(props.defaultActive) // 本地默认选中菜单
152
157
  const mainRef = ref(null) // main容器引用
153
158
 
@@ -366,7 +371,7 @@ const closeIETips = () => {
366
371
  */
367
372
  onMounted(() => {
368
373
  const windowWidth = window.screen.availWidth
369
- minWidth.value = windowWidth > 1800 ? (1800 - props.width) : (windowWidth - props.width)
374
+ minWidth.value = windowWidth > minWidth.value ? (minWidth.value - props.width) : (windowWidth - props.width)
370
375
 
371
376
  browser()
372
377