提交 e15737b9 编写于 作者: V Vben

fix(table): fix table row misalignment close #353

上级 f818bb9a
{ {
"name": "vben-admin", "name": "vben-admin",
"version": "2.0.3", "version": "2.0.3",
"author": {
"name": "vben",
"email": "anncwb@126.com",
"url": "https://github.com/anncwb"
},
"scripts": { "scripts": {
"bootstrap": "yarn install", "bootstrap": "yarn install",
"serve": "npx --max_old_space_size=4096 vite", "serve": "npx --max_old_space_size=4096 vite",
...@@ -28,7 +33,7 @@ ...@@ -28,7 +33,7 @@
}, },
"dependencies": { "dependencies": {
"@iconify/iconify": "^2.0.0-rc.6", "@iconify/iconify": "^2.0.0-rc.6",
"@vueuse/core": "^4.3.4", "@vueuse/core": "^4.3.5",
"@zxcvbn-ts/core": "^0.3.0", "@zxcvbn-ts/core": "^0.3.0",
"ant-design-vue": "2.0.1", "ant-design-vue": "2.0.1",
"apexcharts": "^3.25.0", "apexcharts": "^3.25.0",
...@@ -91,6 +96,7 @@ ...@@ -91,6 +96,7 @@
"is-ci": "^3.0.0", "is-ci": "^3.0.0",
"less": "^4.1.1", "less": "^4.1.1",
"lint-staged": "^10.5.4", "lint-staged": "^10.5.4",
"madge": "^4.0.2",
"postcss": "^8.2.8", "postcss": "^8.2.8",
"prettier": "^2.2.1", "prettier": "^2.2.1",
"pretty-quick": "^3.1.0", "pretty-quick": "^3.1.0",
...@@ -106,7 +112,7 @@ ...@@ -106,7 +112,7 @@
"vite-plugin-compression": "^0.2.3", "vite-plugin-compression": "^0.2.3",
"vite-plugin-html": "^2.0.3", "vite-plugin-html": "^2.0.3",
"vite-plugin-imagemin": "^0.2.9", "vite-plugin-imagemin": "^0.2.9",
"vite-plugin-mock": "^2.2.3", "vite-plugin-mock": "^2.2.4",
"vite-plugin-purge-icons": "^0.7.0", "vite-plugin-purge-icons": "^0.7.0",
"vite-plugin-pwa": "^0.5.6", "vite-plugin-pwa": "^0.5.6",
"vite-plugin-style-import": "^0.8.1", "vite-plugin-style-import": "^0.8.1",
...@@ -120,7 +126,7 @@ ...@@ -120,7 +126,7 @@
"//": "Used to install imagemin dependencies, because imagemin may not be installed in China.If it is abroad, you can delete it", "//": "Used to install imagemin dependencies, because imagemin may not be installed in China.If it is abroad, you can delete it",
"bin-wrapper": "npm:bin-wrapper-china", "bin-wrapper": "npm:bin-wrapper-china",
"esbuild": "0.8.57", "esbuild": "0.8.57",
"rollup": "2.41.0" "rollup": "2.41.1"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
......
<template> <template>
<Button v-bind="getBindValue" :class="[getColor, $attrs.class]"> <Button v-bind="getBindValue" :class="[getColor, $attrs.class]" @click="onClick">
<template #default="data"> <template #default="data">
<Icon :icon="preIcon" v-if="preIcon" :size="14" /> <Icon :icon="preIcon" v-if="preIcon" :size="14" />
<slot v-bind="data"></slot> <slot v-bind="data"></slot>
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
disabled: propTypes.bool, disabled: propTypes.bool,
preIcon: propTypes.string, preIcon: propTypes.string,
postIcon: propTypes.string, postIcon: propTypes.string,
onClick: propTypes.func,
}, },
setup(props, { attrs }) { setup(props, { attrs }) {
const getColor = computed(() => { const getColor = computed(() => {
......
import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent';
export { default as BasicTable } from './src/BasicTable.vue'; export { default as BasicTable } from './src/BasicTable.vue';
export { default as TableAction } from './src/components/TableAction.vue'; export { default as TableAction } from './src/components/TableAction.vue';
export { default as EditTableHeaderIcon } from './src/components/EditTableHeaderIcon.vue'; export { default as EditTableHeaderIcon } from './src/components/EditTableHeaderIcon.vue';
export { default as TableImg } from './src/components/TableImg.vue';
export const TableImg = createAsyncComponent(() => import('./src/components/TableImg.vue'));
export * from './src/types/table'; export * from './src/types/table';
export * from './src/types/pagination'; export * from './src/types/pagination';
......
<template> <template>
<div :class="prefixCls" v-if="imgList && imgList.length"> <div
:class="prefixCls"
class="flex mx-auto items-center"
v-if="imgList && imgList.length"
:style="getWrapStyle"
>
<PreviewGroup> <PreviewGroup>
<template v-for="img in imgList" :key="img"> <template v-for="img in imgList" :key="img">
<Image :width="size" :src="img" /> <Image :width="size" :src="img" />
...@@ -8,27 +13,31 @@ ...@@ -8,27 +13,31 @@
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent, PropType } from 'vue'; import type { CSSProperties } from 'vue';
import { defineComponent, computed } from 'vue';
import { useDesign } from '/@/hooks/web/useDesign'; import { useDesign } from '/@/hooks/web/useDesign';
import { Image } from 'ant-design-vue'; import { Image } from 'ant-design-vue';
import { propTypes } from '/@/utils/propTypes';
export default defineComponent({ export default defineComponent({
name: 'TableImage', name: 'TableImage',
components: { Image, PreviewGroup: Image.PreviewGroup }, components: { Image, PreviewGroup: Image.PreviewGroup },
props: { props: {
imgList: { imgList: propTypes.arrayOf(propTypes.string),
type: Array as PropType<string[]>, size: propTypes.number.def(40),
default: null,
},
size: {
type: Number as PropType<number>,
default: 40,
},
}, },
setup() { setup(props) {
const getWrapStyle = computed(
(): CSSProperties => {
const { size } = props;
const wh = `${size}px`;
return { height: wh, width: wh };
}
);
const { prefixCls } = useDesign('basic-table-img'); const { prefixCls } = useDesign('basic-table-img');
return { prefixCls }; return { prefixCls, getWrapStyle };
}, },
}); });
</script> </script>
...@@ -36,8 +45,6 @@ ...@@ -36,8 +45,6 @@
@prefix-cls: ~'@{namespace}-basic-table-img'; @prefix-cls: ~'@{namespace}-basic-table-img';
.@{prefix-cls} { .@{prefix-cls} {
display: flex;
.ant-image { .ant-image {
margin-right: 4px; margin-right: 4px;
cursor: zoom-in; cursor: zoom-in;
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册