修复 src 结构
This commit is contained in:
9
src/component/col/index.ts
Normal file
9
src/component/col/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { App } from "vue";
|
||||
import Component from "./index.vue";
|
||||
import type { IDefineComponent } from "../type/index";
|
||||
|
||||
Component.install = (app: App) => {
|
||||
app.component(Component.name || "LayCol", Component);
|
||||
};
|
||||
|
||||
export default Component as IDefineComponent;
|
||||
39
src/component/col/index.vue
Normal file
39
src/component/col/index.vue
Normal file
@@ -0,0 +1,39 @@
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: "LayCol",
|
||||
};
|
||||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, defineProps } from "vue";
|
||||
|
||||
const props = defineProps<{
|
||||
md?: string;
|
||||
xs?: string;
|
||||
sm?: string;
|
||||
lg?: string;
|
||||
mdOffset?: string;
|
||||
xsOffset?: string;
|
||||
smOffset?: string;
|
||||
lgOffset?: string;
|
||||
}>();
|
||||
|
||||
const classes = computed(() => {
|
||||
return [
|
||||
props.md ? `layui-col-md${props.md}` : "",
|
||||
props.xs ? `layui-col-xs${props.xs}` : "",
|
||||
props.sm ? `layui-col-sm${props.sm}` : "",
|
||||
props.lg ? `layui-col-lg${props.lg}` : "",
|
||||
props.mdOffset ? `layui-col-md-offset${props.mdOffset}` : "",
|
||||
props.xsOffset ? `layui-col-xs-offset${props.xsOffset}` : "",
|
||||
props.smOffset ? `layui-col-sm-offset${props.smOffset}` : "",
|
||||
props.lgOffset ? `layui-col-lg-offset${props.lgOffset}` : "",
|
||||
];
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="layui-col" :class="classes">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user