component_ryl_v3 1.1.5 → 1.1.7

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,28 @@ 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
+
8
29
 
9
30
  # 询问窗口组件
10
31
  # 使用方法
@@ -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();
@@ -662,7 +666,9 @@ const _sfc_main$4 = {
662
666
  }),
663
667
  createElementVNode("div", _hoisted_7, [
664
668
  createElementVNode("div", _hoisted_8, [
665
- renderSlot(_ctx.$slots, "content")
669
+ createElementVNode("div", null, [
670
+ renderSlot(_ctx.$slots, "content")
671
+ ])
666
672
  ]),
667
673
  showFooter.value ? (openBlock(), createElementBlock("div", {
668
674
  key: 0,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "component_ryl_v3",
3
3
  "private": false,
4
- "version": "1.1.5",
4
+ "version": "1.1.7",
5
5
  "type": "module",
6
6
  "description": "Vue3 login form component with Element Plus",
7
7
  "main": "./dist/component_ryl_v3.js",
package/src/App.vue CHANGED
@@ -4,6 +4,7 @@
4
4
  collapse
5
5
  :defaultActive="menuActive"
6
6
  :menuList="menuList"
7
+ ref="menuRef"
7
8
  >
8
9
  <template #headElseTitle>
9
10
  <div style="color:#fff;text-align:center;font-size:20px;">
@@ -31,6 +32,7 @@
31
32
  </ul>
32
33
  </template>
33
34
  <template #content>
35
+ <div class="lll">
34
36
  <h6>Tab</h6>
35
37
  <hand-tab :list="[{ label: '全部', value: 'all' }, { label: '待处理是的', value: 'pending' }, { label: '已处理', value: 'processed' }]" @getStatus="getStatus" />
36
38
  <h6>图片预览</h6>
@@ -40,6 +42,7 @@
40
42
  <div>
41
43
  <hand-paging :currentPage="handPagingRef.page" :total="handPagingRef.total" :pageSize="handPagingRef.pageSize" :size="handPagingRef.size" @page-change="handlePageChange" />
42
44
  </div>
45
+ <!-- <div v-for="(item,index) in 100">{{index}}</div> -->
43
46
  <h6>空数据提示</h6>
44
47
  <hand-no-data title="暂无数据" />
45
48
  <h6>弹窗</h6>
@@ -69,12 +72,13 @@
69
72
  <el-input v-model="inputNumber" v-number="{max:100}" placeholder="请输入"></el-input>
70
73
  <span>复制</span><br>
71
74
  <el-button v-copy="['这是复制的内容',copyBack]">点击复制</el-button>
75
+ </div>
72
76
  </template>
73
77
  </hand-header>
74
78
  </template>
75
79
 
76
80
  <script setup>
77
- import { ref } from 'vue'
81
+ import { ref, onMounted } from 'vue'
78
82
  import HandHeader from './packages/handHeader/handHeader.vue'
79
83
  import HandTab from './packages/handTab/handTab.vue'
80
84
  import HandSeeImg from './packages/handSeeImg/handSeeImg.vue'
@@ -214,6 +218,11 @@ const copyBack = (err, success) => {
214
218
  }
215
219
  }
216
220
  //#endregion 自定义指令
217
-
221
+ //#region 菜单组件
222
+ const menuRef = ref(null)
223
+ onMounted(() => {
224
+ menuRef.value.getMainHeight()
225
+ })
226
+ //#endregion 菜单组件
218
227
  const inputNumber = ref('')
219
228
  </script>
@@ -64,7 +64,9 @@
64
64
  <div class="content_mar">
65
65
  <div class="content inner_content">
66
66
  <!-- 内容展示区域 -->
67
- <slot name="content"></slot>
67
+ <div>
68
+ <slot name="content"></slot>
69
+ </div>
68
70
  </div>
69
71
  <div class="footer flex flex_col inner_footer" v-html="userInfo.copyRight" v-if="showFooter"></div>
70
72
  </div>
@@ -92,6 +94,7 @@ import sidebarItem from './sidebarItem.vue'
92
94
  * @property {string} defaultActive - 默认选中的菜单路径
93
95
  * @property {boolean} collapse - 是否启用折叠功能
94
96
  * @property {number} width - 侧边栏宽度
97
+ * @property {number} contentWidth - 内容模块宽度
95
98
  * @property {Object} userInfo - 用户信息
96
99
  * @property {boolean} showDefaltOpen - 是否默认展开所有菜单项
97
100
  */
@@ -120,6 +123,10 @@ const props = defineProps({
120
123
  type: Number,
121
124
  default: 180
122
125
  },
126
+ contentWidth: {
127
+ type: Number,
128
+ default: 1200
129
+ },
123
130
  userInfo: {
124
131
  type: Object,
125
132
  default: () => ({})
@@ -145,7 +152,7 @@ const defaultOpen = ref([]) // 默认打开的菜单
145
152
  const isIE = ref(false) // 是否是ie浏览器
146
153
  const hideMenu = ref(false) // 是否隐藏菜单
147
154
  const showFooter = ref(false) // 效果展示优化
148
- const minWidth = ref(0) // 内容模块的默认最小宽度
155
+ const minWidth = ref(props.contentWidth) // 内容模块的默认最小宽度
149
156
  const localDefaultActive = ref(props.defaultActive) // 本地默认选中菜单
150
157
  const mainRef = ref(null) // main容器引用
151
158
 
@@ -364,7 +371,7 @@ const closeIETips = () => {
364
371
  */
365
372
  onMounted(() => {
366
373
  const windowWidth = window.screen.availWidth
367
- minWidth.value = windowWidth > 1800 ? (1800 - props.width) : (windowWidth - props.width)
374
+ minWidth.value = windowWidth > minWidth.value ? (minWidth.value - props.width) : (windowWidth - props.width)
368
375
 
369
376
  browser()
370
377