-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(Textarea): new textarea (#523)
* refactor(Textarea): new textarea * test: update snapshots * fix: fix cr
- Loading branch information
Showing
72 changed files
with
40,938 additions
and
38,894 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,43 @@ | ||
<template> | ||
<div class="tdesign-mobile-demo-block"> | ||
<h2 v-if="title" class="tdesign-mobile-demo-block__title">{{ title }}</h2> | ||
<p v-if="summary" class="tdesign-mobile-demo-block__summary">{{ summary }}</p> | ||
<slot></slot> | ||
<div :class="rootClassName"> | ||
<div v-if="title || summary" class="tdesign-mobile-demo-block__header"> | ||
<h2 v-if="title" class="tdesign-mobile-demo-block__title">{{ title }}</h2> | ||
<p v-if="summary" :class="summaryClassName"> | ||
{{ summary }} | ||
</p> | ||
</div> | ||
<div :class="slotClassName"> | ||
<slot /> | ||
</div> | ||
</div> | ||
</template> | ||
<script lang="ts" setup> | ||
import { computed } from 'vue'; | ||
const props = defineProps<{ | ||
title?: String; | ||
summary?: String; | ||
padding?: Boolean; | ||
}>(); | ||
const rootClassName = computed(() => [ | ||
'tdesign-mobile-demo-block', | ||
{ | ||
['tdesign-mobile-demo-block_notitle']: !!props.title, | ||
}, | ||
]); | ||
const summaryClassName = computed(() => [ | ||
`tdesign-mobile-demo-block__summary`, | ||
{ | ||
['tdesign-mobile-demo-block_subtitle']: !!props.title, | ||
}, | ||
]); | ||
const slotClassName = computed(() => [ | ||
`tdesign-mobile-demo-block__slot`, | ||
{ | ||
['with-padding']: props.padding, | ||
}, | ||
]); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,59 @@ | ||
.tdesign-mobile-demo { | ||
background-color: #F6F6F6; | ||
background-color: #f6f6f6; | ||
font-family: "PingFang SC"; | ||
padding-bottom: 28px; | ||
|
||
.title { | ||
padding: 24px 16px 8px 16px; | ||
opacity: 1; | ||
color: rgba(0, 0, 0, 0.9); | ||
font-size: 20px; | ||
font-size: 24px; | ||
font-weight: 700; | ||
line-height: 28px; | ||
line-height: 32px; | ||
margin: 24px 16px 0; | ||
color: rgba(0, 0, 0, .9); | ||
} | ||
|
||
.summary { | ||
opacity: 1; | ||
color: rgba(0, 0, 0, 0.4); | ||
font-size: 12px; | ||
font-size: 14px; | ||
color: rgba(0, 0, 0, 0.6); | ||
margin: 8px 16px 0; | ||
line-height: 22px; | ||
padding: 0 16px; | ||
} | ||
|
||
&-block { | ||
width: 100%; | ||
margin: 32px 0 0; | ||
|
||
&__title { | ||
padding: 24px 16px 0; | ||
font-size: 16px; | ||
font-weight: 700; | ||
&__header { | ||
color: #000; | ||
margin: 0 16px; | ||
} | ||
|
||
&__title + &__summary { | ||
padding: 8px 16px 16px; | ||
&__title { | ||
font-weight: 700; | ||
font-size: 18px; | ||
line-height: 26px; | ||
} | ||
|
||
&__summary { | ||
opacity: 1; | ||
color: rgba(0, 0, 0, 0.4); | ||
font-size: 12px; | ||
margin-top: 8px; | ||
font-size: 14px; | ||
white-space: pre-line; | ||
color: rgba(0, 0, 0, 0.6); | ||
line-height: 22px; | ||
padding: 16px; | ||
} | ||
|
||
&__slot { | ||
margin-top: 16px; | ||
|
||
&.with-padding { | ||
margin: 16px 16px 0; | ||
} | ||
} | ||
} | ||
} | ||
|
||
.tdesign-mobile-demo-block_notitle { | ||
margin-top: 0px; | ||
|
||
.tdesign-mobile-demo-block_subtitle { | ||
margin-top: 24px; | ||
} | ||
} |
Oops, something went wrong.