-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Text): 文本组件新增 gradient 属性 (#779)
* feat: 文本组件新增gradient属性,增加相应的demo * feat: pr问题修改,增加统一处理deg的方法 --------- Co-authored-by: blankzhang <[email protected]>
- Loading branch information
1 parent
b0f3501
commit 3aec03a
Showing
6 changed files
with
98 additions
and
10 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
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,3 +1,9 @@ | ||
export type Type = 'default' | 'success' | 'info' | 'warning' | 'danger'; | ||
|
||
export type Size = 'small' | 'middle' | 'large'; | ||
|
||
export interface Gradient { | ||
from: string; | ||
to: string; | ||
deg: number | string; | ||
} |
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
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
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<template> | ||
<div> | ||
<FText :gradient="gradientColor1"> | ||
这是渐变色的文本,角度为数值类型 | ||
</FText> | ||
</div> | ||
<div> | ||
<FText :gradient="gradientColor2"> | ||
这是渐变色的文本,角度为字符串类型 | ||
</FText> | ||
</div> | ||
<div> | ||
<FText :gradient="color"> | ||
这是纯色的文本 | ||
</FText> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
const gradientColor1 = { | ||
deg: 90, | ||
from: '#5384ff', | ||
to: '#00cb91', | ||
}; | ||
const gradientColor2 = { | ||
deg: '90deg', | ||
from: '#5384ff', | ||
to: '#00cb91', | ||
}; | ||
const color = { | ||
from: '#5384ff', | ||
to: '#5384ff', | ||
}; | ||
</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