修复 src 结构
This commit is contained in:
5
src/component/side/index.less
Normal file
5
src/component/side/index.less
Normal file
@@ -0,0 +1,5 @@
|
||||
.layui-side {
|
||||
overflow: auto;
|
||||
box-sizing: border-box;
|
||||
min-height: 300px;
|
||||
}
|
||||
9
src/component/side/index.ts
Normal file
9
src/component/side/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 || "LaySide", Component);
|
||||
};
|
||||
|
||||
export default Component as IDefineComponent;
|
||||
30
src/component/side/index.vue
Normal file
30
src/component/side/index.vue
Normal file
@@ -0,0 +1,30 @@
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: "LaySide",
|
||||
};
|
||||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, defineProps, CSSProperties } from "vue";
|
||||
import "./index.less";
|
||||
|
||||
export interface LaySideProps {
|
||||
width?: string | number;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<LaySideProps>(), {
|
||||
width: "200",
|
||||
});
|
||||
|
||||
const styles = computed<CSSProperties>(() => {
|
||||
return {
|
||||
width: `${props.width}px`,
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="layui-side" :style="styles">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user