Skip to content

Commit

Permalink
feat: 重写示例
Browse files Browse the repository at this point in the history
  • Loading branch information
xkfe committed Aug 5, 2024
1 parent 9e0712b commit 82f8d8e
Show file tree
Hide file tree
Showing 13 changed files with 714 additions and 774 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"@element-plus/icons-vue": "^2.3.1",
"@unocss/reset": "^0.61.5",
"@vueuse/core": "^10.11.0",
"axios": "^1.7.3",
"dayjs": "^1.11.12",
"element-plus": "^2.7.7",
"sortablejs": "^1.15.2",
Expand Down
3 changes: 2 additions & 1 deletion packages/components/ProTable/components/ColSetting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ defineExpose({
<template>
<!-- 列设置 -->
<el-drawer v-model="drawerVisible" title="列设置" size="450px">
<div class="card table-main">
<div class="table-main">
<el-table :data="colSetting" :border="true" row-key="prop" default-expand-all :tree-props="{ children: '_children' }">
<el-table-column prop="label" align="center" label="列名" />
<el-table-column v-slot="scope" prop="isShow" align="center" label="显示">
Expand All @@ -36,6 +36,7 @@ defineExpose({
</template>
</el-table>
</div>
<template #footer />
</el-drawer>
</template>

Expand Down
10 changes: 5 additions & 5 deletions packages/components/ProTable/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ defineExpose({
/>

<!-- 表格主体 -->
<div class="card table-main">
<div class="table-main">
<!-- 表格头部 操作按钮 -->
<div class="table-header">
<div class="header-button-lf">
Expand Down Expand Up @@ -271,20 +271,20 @@ defineExpose({
v-if="item.type && columnTypes.includes(item.type)"
v-bind="item"
:align="item.align ?? 'center'"
:reserve-selection="item.type == 'selection'"
:reserve-selection="item.type === 'selection'"
>
<template #default="scope">
<!-- expand -->
<template v-if="item.type == 'expand'">
<template v-if="item.type === 'expand'">
<component :is="item.render" v-bind="scope" v-if="item.render" />
<slot v-else :name="item.type" v-bind="scope" />
</template>
<!-- radio -->
<el-radio v-if="item.type == 'radio'" v-model="radio" :label="scope.row[rowKey]">
<el-radio v-if="item.type === 'radio'" v-model="radio" :label="scope.row[rowKey]">
<i />
</el-radio>
<!-- sort -->
<el-tag v-if="item.type == 'sort'" class="move">
<el-tag v-if="item.type === 'sort'" class="move">
<el-icon> <DCaret /></el-icon>
</el-tag>
</template>
Expand Down
4 changes: 2 additions & 2 deletions packages/components/SearchForm/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ const showCollapse = computed(() => {
</script>

<template>
<div v-if="columns.length" class="card table-search">
<el-form ref="formRef" :model="searchParam">
<div v-if="columns.length" class="table-search">
<el-form :model="searchParam">
<Grid ref="gridRef" :collapsed="collapsed" :gap="[20, 0]" :cols="searchCol">
<GridItem v-for="(item, index) in columns" :key="item.prop" v-bind="getResponsive(item)" :index="index">
<el-form-item>
Expand Down
73 changes: 73 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 82f8d8e

Please sign in to comment.