@peng_kai/kit 0.3.0-beta.24 → 0.3.0-beta.25

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.
@@ -48,14 +48,13 @@ function reset() {
48
48
  const tableColumns = inject('tableColumns', props.tableColumns) as TableColumnsType<any>;
49
49
  const tableColumnsConfig = inject('tableColumnsConfig') as Ref<ColumnConfig[]>;
50
50
  function openTableSettingModal() {
51
- // const tableColumns = props.tableColumns?.map((x: any) => ({
52
- // ...x,
53
- // title: typeof x.title === 'string' ? x.title : x.dataIndex || '',
54
- // })) || [];
55
51
 
56
- if (!tableColumns || !tableColumnsConfig) return;
52
+ if (!tableColumns) return;
57
53
 
58
- TableSettingModal.open({ tableColumns, tableColumnsConfig } as any)?.then((res) => {
54
+ TableSettingModal.open({
55
+ tableColumns,
56
+ tableColumnsConfig: tableColumnsConfig.value || []
57
+ } as any)?.then((res) => {
59
58
  TableSettingModal.close();
60
59
  if (res) {
61
60
  tableColumnsConfig.value = res;
@@ -80,13 +79,13 @@ onTtaTimeZone(() => {
80
79
  <Button :disabled="loading" @click="reset()">
81
80
  重置
82
81
  </Button>
83
- <Dropdown trigger="click" placement="bottomRight">
82
+ <Dropdown trigger="click" placement="bottomRight" >
84
83
  <Button class="px-1 w-8">
85
84
  <i class="i-si:more-square-horiz-fill scale-130 transform-origin-bottom-center" />
86
85
  </Button>
87
86
  <template #overlay>
88
87
  <Menu>
89
- <MenuItem v-if="tableColumns && tableColumnsConfig" @click="openTableSettingModal">
88
+ <MenuItem v-if="tableColumns" @click="openTableSettingModal">
90
89
  设置表格
91
90
  </MenuItem>
92
91
  </Menu>
@@ -79,13 +79,13 @@ defineExpose({
79
79
  <div v-for="(col, i) in columnsConfig" :key="col.dataIndex" :index="i"
80
80
  class="flex items-center gap-2 p-2 select-none">
81
81
  <div
82
- class="drag-handler flex items-center justify-center p-1 -m-2 mr-auto"
83
- :class="{ 'pointer-events-none !cursor-no-drop': col.fixed }"
82
+ class="drag-handler flex items-center justify-center p-1 -m-2 "
83
+ :class="{ '!pointer-events-none !cursor-no-drop': col.fixed }"
84
84
  >
85
85
  <i class="i-material-symbols:drag-indicator" :class="{ 'op-0': col.fixed }" />&nbsp;
86
- <span>{{ col.title }}</span>
87
86
  </div>
88
- <RadioGroup v-model:value="columnsShowValue[col.dataIndex]" :options="columnsShowOptions[col.dataIndex]"
87
+ <span>{{ col.title }}</span>
88
+ <RadioGroup class="ml-auto" v-model:value="columnsShowValue[col.dataIndex]" :options="columnsShowOptions[col.dataIndex]"
89
89
  optionType="button" buttonStyle="solid" size="small" />
90
90
  <!-- <Select v-model:value="columnsShowValue[col.dataIndex]" :options="columnsShowOptions[col.dataIndex]" /> -->
91
91
  </div>
@@ -82,7 +82,7 @@ function useTab(router: ShallowRef<Router | null>, options: TOptions = {}) {
82
82
  const lastTime = Date.now();
83
83
  const isReplaced = history.state?.replaced;
84
84
  const tabType = Number(history.state?.tabType ?? 1); // 0:不新增 tab, 1:新增 tab, 2: 固定 tab(不可关闭)
85
-
85
+
86
86
  // 0. 刷新页面
87
87
  if (toTab && toTab?.path === fromTab?.path) {
88
88
  const components = to.matched[1].components as Record<string, any>;
@@ -155,7 +155,7 @@ function useTab(router: ShallowRef<Router | null>, options: TOptions = {}) {
155
155
  const compName = currentTab.value?.path;
156
156
 
157
157
  if (mainComp && compName)
158
- mainComp.__name = compName;
158
+ mainComp.__name = to.fullPath;
159
159
  }
160
160
  });
161
161
  });
@@ -5,18 +5,13 @@ import { KeepAlive, type KeepAliveProps } from 'vue';
5
5
  const props = defineProps<{
6
6
  cached: KeepAliveProps['include']
7
7
  }>();
8
-
9
- function side(comp: any) {
10
- console.log('🤡 / side / comp:', comp)
11
- return comp;
12
- }
13
8
  </script>
14
9
 
15
10
  <template>
16
11
  <RouterView #default="{ Component }">
17
12
  <KeepAlive :include="props.cached">
18
13
  <Suspense>
19
- <component :is="Component" :key="$route.fullPath" />
14
+ <component :is="Component" :key="(Component as any).type?.__name" />
20
15
  <template #fallback>
21
16
  <div class="flex justify-center items-center h-full">
22
17
  <div class="flex items-center">
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@peng_kai/kit",
3
3
  "type": "module",
4
- "version": "0.3.0-beta.24",
4
+ "version": "0.3.0-beta.25",
5
5
  "description": "",
6
6
  "author": "",
7
7
  "license": "ISC",