Merge branch 'feat-tag' into next

This commit is contained in:
sight
2022-08-27 17:20:18 +08:00
4 changed files with 116 additions and 91 deletions

View File

@@ -35,13 +35,16 @@ export interface LaySpaceProps {
}
const props = withDefaults(defineProps<LaySpaceProps>(), {
align: "center",
direction: "horizontal",
size: "sm",
});
const slots = useSlots();
const computAlign = computed(
() => props.align ?? (props.direction === "horizontal" ? "center" : "")
);
const extractChildren = () => {
const result: VNode[] = [];
const children = slots.default && (slots?.default() as VNodeArrayChildren);
@@ -73,7 +76,7 @@ const extractChildren = () => {
const spaceClass = computed(() => [
"layui-space",
{
[`layui-space-align-${props.align}`]: props.align,
[`layui-space-align-${props.align}`]: computAlign.value,
[`layui-space-${props.direction}`]: props.direction,
[`layui-space-wrap`]: props.wrap,
[`layui-space-fill`]: props.fill,

View File

@@ -23,7 +23,7 @@
.layui-tag {
display: inline-flex;
align-items: center;
align-items: baseline;
vertical-align: middle;
box-sizing: border-box;
height: @tag-size-md;

View File

@@ -89,6 +89,7 @@ import LayPageHeader from "./component/pageHeader/index";
import LayCascader from "./component/cascader/index";
import LayAffix from "./component/affix/index";
import LaySpace from "./component/space/index";
import LayTag from "./component/tag/index";
import LayConfigProvider from "./provider";
import { InstallOptions } from "./types";
@@ -176,6 +177,7 @@ const components: Record<string, Plugin> = {
LayCascader,
LayAffix,
LaySpace,
LayTag,
};
const install = (app: App, options?: InstallOptions): void => {
@@ -270,6 +272,7 @@ export {
LayCascader,
LayAffix,
LaySpace,
LayTag,
install,
};