feat: 添加 Divider 和 Input 组件,更新主题变量
This commit is contained in:
31
src/components/ui/divider/index.vue
Normal file
31
src/components/ui/divider/index.vue
Normal file
@@ -0,0 +1,31 @@
|
||||
<script lang='ts' setup>
|
||||
defineProps<{ text?: string }>();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="divider ion-margin-vertical" v-bind="$attrs">
|
||||
<span>{{ text }}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.divider {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.divider::before,
|
||||
.divider::after {
|
||||
content: "";
|
||||
flex: 1;
|
||||
border-bottom: 1px solid var(--ion-color-medium);
|
||||
}
|
||||
|
||||
.divider span {
|
||||
padding: 0 10px;
|
||||
color: var(--ion-color-medium);
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
27
src/components/ui/input/index.vue
Normal file
27
src/components/ui/input/index.vue
Normal file
@@ -0,0 +1,27 @@
|
||||
<script lang='ts' setup>
|
||||
import type { ComponentInstance } from "vue";
|
||||
import { IonInput } from "@ionic/vue";
|
||||
import { h } from "vue";
|
||||
|
||||
const vm = getCurrentInstance()!;
|
||||
|
||||
function changeRef(exposed: any) {
|
||||
vm.exposed = exposed;
|
||||
}
|
||||
|
||||
defineExpose({} as ComponentInstance<typeof IonInput>);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<component :is="h(IonInput, { ...$attrs, ref: changeRef })" class="ui-input" />
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.ui-input {
|
||||
--padding-start: 12px;
|
||||
--padding-end: 12px;
|
||||
--background: var(--ui-input-background, #fff);
|
||||
--color: var(--ui-input-color, #000);
|
||||
--border-radius: 8px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user