更新:登录功能
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
@import '../common/abstracts/variable.scss';
|
||||
@import '../common/abstracts/_mixin.scss';
|
||||
|
||||
.wot-theme-dark {
|
||||
@include b(cell-group) {
|
||||
background-color: $-dark-background2;
|
||||
|
||||
@include when(border) {
|
||||
.wd-cell-group__title {
|
||||
@include halfPixelBorder('bottom', 0, $-dark-border-color);
|
||||
}
|
||||
}
|
||||
|
||||
@include e(title) {
|
||||
background: $-dark-background2;
|
||||
color: $-dark-color;
|
||||
}
|
||||
|
||||
@include e(right) {
|
||||
color: $-dark-color3;
|
||||
}
|
||||
|
||||
@include e(body) {
|
||||
background: $-dark-background2;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@include b(cell-group) {
|
||||
background-color: $-color-white;
|
||||
|
||||
@include when(border) {
|
||||
.wd-cell-group__title {
|
||||
@include halfPixelBorder;
|
||||
}
|
||||
}
|
||||
@include e(title) {
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: $-cell-group-padding;
|
||||
background: $-color-white;
|
||||
font-size: $-cell-group-title-fs;
|
||||
color: $-cell-group-title-color;
|
||||
font-weight: $-fw-medium;
|
||||
line-height: 1.43;
|
||||
}
|
||||
@include e(right) {
|
||||
color: $-cell-group-value-color;
|
||||
font-size: $-cell-group-value-fs;
|
||||
}
|
||||
@include e(body) {
|
||||
background: $-color-white;
|
||||
}
|
||||
}
|
||||
41
uni_modules/wot-design-uni/components/wd-cell-group/types.ts
Normal file
41
uni_modules/wot-design-uni/components/wd-cell-group/types.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* @Author: weisheng
|
||||
* @Date: 2023-12-14 11:21:58
|
||||
* @LastEditTime: 2024-03-18 13:57:14
|
||||
* @LastEditors: weisheng
|
||||
* @Description:
|
||||
* @FilePath: \wot-design-uni\src\uni_modules\wot-design-uni\components\wd-cell-group\types.ts
|
||||
* 记得注释
|
||||
*/
|
||||
import { type ExtractPropTypes, type InjectionKey } from 'vue'
|
||||
import { baseProps, makeBooleanProp } from '../common/props'
|
||||
|
||||
export type CelllGroupProvide = {
|
||||
props: {
|
||||
border?: boolean
|
||||
}
|
||||
}
|
||||
|
||||
export const CELL_GROUP_KEY: InjectionKey<CelllGroupProvide> = Symbol('wd-cell-group')
|
||||
|
||||
export const cellGroupProps = {
|
||||
...baseProps,
|
||||
/**
|
||||
* 分组标题
|
||||
*/
|
||||
title: String,
|
||||
/**
|
||||
* 分组右侧内容
|
||||
*/
|
||||
value: String,
|
||||
/**
|
||||
* 分组启用插槽
|
||||
*/
|
||||
useSlot: makeBooleanProp(false),
|
||||
/**
|
||||
* 是否展示边框线
|
||||
*/
|
||||
border: makeBooleanProp(false)
|
||||
}
|
||||
|
||||
export type CellGroupProps = ExtractPropTypes<typeof cellGroupProps>
|
||||
@@ -0,0 +1,45 @@
|
||||
<template>
|
||||
<view :class="['wd-cell-group', border ? 'is-border' : '', customClass]" :style="customStyle">
|
||||
<view v-if="title || value || useSlot" class="wd-cell-group__title">
|
||||
<!--左侧标题-->
|
||||
<view class="wd-cell-group__left">
|
||||
<text v-if="!$slots.title">{{ title }}</text>
|
||||
<slot v-else name="title"></slot>
|
||||
</view>
|
||||
<!--右侧标题-->
|
||||
<view class="wd-cell-group__right">
|
||||
<text v-if="!$slots.value">{{ value }}</text>
|
||||
<slot v-else name="value"></slot>
|
||||
</view>
|
||||
</view>
|
||||
<view class="wd-cell-group__body">
|
||||
<slot></slot>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'wd-cell-group',
|
||||
options: {
|
||||
addGlobalClass: true,
|
||||
virtualHost: true,
|
||||
styleIsolation: 'shared'
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useChildren } from '../composables/useChildren'
|
||||
import { CELL_GROUP_KEY, cellGroupProps } from './types'
|
||||
|
||||
const props = defineProps(cellGroupProps)
|
||||
|
||||
const { linkChildren } = useChildren(CELL_GROUP_KEY)
|
||||
|
||||
linkChildren({ props })
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './index.scss';
|
||||
</style>
|
||||
Reference in New Issue
Block a user