修复 src 结构
This commit is contained in:
9
src/component/progress/index.ts
Normal file
9
src/component/progress/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 || "LayProgress", Component);
|
||||
};
|
||||
|
||||
export default Component as IDefineComponent;
|
||||
41
src/component/progress/index.vue
Normal file
41
src/component/progress/index.vue
Normal file
@@ -0,0 +1,41 @@
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: "LayProgress",
|
||||
};
|
||||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, defineProps } from "vue";
|
||||
|
||||
const props = defineProps<{
|
||||
percent: number | string;
|
||||
theme?: string;
|
||||
color?: string;
|
||||
size?: string;
|
||||
showText?: boolean;
|
||||
text?: string;
|
||||
}>();
|
||||
|
||||
const styles = computed(() => {
|
||||
return [
|
||||
props.color ? "background-color: " + props.color : "",
|
||||
{
|
||||
width: props.percent + "%",
|
||||
},
|
||||
];
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="layui-progress" :class="'layui-progress-' + size">
|
||||
<div
|
||||
class="layui-progress-bar"
|
||||
:class="'layui-bg-' + theme"
|
||||
:style="styles"
|
||||
>
|
||||
<span v-if="showText" class="layui-progress-text">
|
||||
{{ text ? text : percent + "%" }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user