更新:登录功能
This commit is contained in:
71
uni_modules/wot-design-uni/components/wd-card/index.scss
Normal file
71
uni_modules/wot-design-uni/components/wd-card/index.scss
Normal file
@@ -0,0 +1,71 @@
|
||||
@import "../common/abstracts/variable.scss";
|
||||
@import "../common/abstracts/_mixin.scss";
|
||||
.wot-theme-dark {
|
||||
@include b(card) {
|
||||
background-color: $-dark-background2;
|
||||
|
||||
@include when(rectangle) {
|
||||
|
||||
.wd-card__content {
|
||||
@include halfPixelBorder('top', 0, $-dark-border-color);
|
||||
}
|
||||
.wd-card__footer {
|
||||
@include halfPixelBorder('top', 0, $-dark-border-color);
|
||||
}
|
||||
}
|
||||
|
||||
@include e(title-content) {
|
||||
color: $-dark-color;
|
||||
}
|
||||
@include e(content) {
|
||||
color: $-dark-color3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@include b(card) {
|
||||
padding: $-card-padding;
|
||||
background-color: $-card-bg;
|
||||
line-height: $-card-line-height;
|
||||
margin: $-card-margin;
|
||||
border-radius: $-card-radius;
|
||||
box-shadow: $-card-shadow-color;
|
||||
font-size: $-card-fs;
|
||||
margin-bottom: 12px;
|
||||
|
||||
@include when(rectangle) {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
border-radius: 0;
|
||||
box-shadow: none;
|
||||
|
||||
.wd-card__title-content {
|
||||
font-size: $-card-fs;
|
||||
}
|
||||
.wd-card__content {
|
||||
position: relative;
|
||||
padding: $-card-rectangle-content-padding;
|
||||
|
||||
@include halfPixelBorder('top', 0, $-card-content-border-color);
|
||||
}
|
||||
.wd-card__footer {
|
||||
position: relative;
|
||||
padding: $-card-rectangle-footer-padding;
|
||||
|
||||
@include halfPixelBorder('top', 0, $-card-content-border-color);
|
||||
}
|
||||
}
|
||||
@include e(title-content) {
|
||||
padding: 16px 0;
|
||||
color: $-card-title-color;
|
||||
font-size: $-card-title-fs;
|
||||
}
|
||||
@include e(content) {
|
||||
color: $-card-content-color;
|
||||
line-height: $-card-content-line-height;
|
||||
}
|
||||
@include e(footer) {
|
||||
padding: $-card-footer-padding;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
30
uni_modules/wot-design-uni/components/wd-card/types.ts
Normal file
30
uni_modules/wot-design-uni/components/wd-card/types.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import type { ExtractPropTypes, PropType } from 'vue'
|
||||
import { baseProps, makeStringProp } from '../common/props'
|
||||
|
||||
export type CardType = 'rectangle'
|
||||
|
||||
export const cardProps = {
|
||||
...baseProps,
|
||||
/**
|
||||
* 卡片类型
|
||||
*/
|
||||
type: String as PropType<CardType>,
|
||||
/**
|
||||
* 卡片标题
|
||||
*/
|
||||
title: String,
|
||||
/**
|
||||
* 标题自定义样式
|
||||
*/
|
||||
customTitleClass: makeStringProp(''),
|
||||
/**
|
||||
* 内容自定义样式
|
||||
*/
|
||||
customContentClass: makeStringProp(''),
|
||||
/**
|
||||
* 底部自定义样式
|
||||
*/
|
||||
customFooterClass: makeStringProp('')
|
||||
}
|
||||
|
||||
export type CardProps = ExtractPropTypes<typeof cardProps>
|
||||
37
uni_modules/wot-design-uni/components/wd-card/wd-card.vue
Normal file
37
uni_modules/wot-design-uni/components/wd-card/wd-card.vue
Normal file
@@ -0,0 +1,37 @@
|
||||
<template>
|
||||
<view :class="['wd-card', type == 'rectangle' ? 'is-rectangle' : '', customClass]" :style="customStyle">
|
||||
<view :class="['wd-card__title-content', customTitleClass]" v-if="title || $slots.title">
|
||||
<view class="wd-card__title">
|
||||
<text v-if="title">{{ title }}</text>
|
||||
<slot v-else name="title"></slot>
|
||||
</view>
|
||||
</view>
|
||||
<view :class="`wd-card__content ${customContentClass}`">
|
||||
<slot></slot>
|
||||
</view>
|
||||
<view :class="`wd-card__footer ${customFooterClass}`" v-if="$slots.footer">
|
||||
<slot name="footer"></slot>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'wd-card',
|
||||
options: {
|
||||
addGlobalClass: true,
|
||||
virtualHost: true,
|
||||
styleIsolation: 'shared'
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { cardProps } from './types'
|
||||
|
||||
defineProps(cardProps)
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './index.scss';
|
||||
</style>
|
||||
Reference in New Issue
Block a user