mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-02-23 13:31:06 +08:00
feat(color): add color-transition to declare transition explicitly
This commit is contained in:
parent
9b5c7cf390
commit
f5ac074f70
@ -30,6 +30,10 @@ export default {
|
||||
color: {
|
||||
type: String,
|
||||
default: undefined
|
||||
},
|
||||
colorTransition: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -48,14 +52,14 @@ export default {
|
||||
const parent = this.$parent
|
||||
if (parent && parent.$options.__NAIVE_ICON__) return getSlot(this)
|
||||
else {
|
||||
const mergedTheme = this.mergedTheme
|
||||
const depth = this.depth
|
||||
const { mergedTheme, depth, colorTransition } = this.mergedTheme
|
||||
return h('i', {
|
||||
...this.$attrs,
|
||||
class: {
|
||||
'n-icon': true,
|
||||
[`n-${mergedTheme}-theme`]: mergedTheme,
|
||||
[`n-icon--${depth}-depth`]: depth
|
||||
[`n-icon--${depth}-depth`]: depth,
|
||||
'n-icon--color-transition': colorTransition
|
||||
},
|
||||
style: {
|
||||
...this.styles,
|
||||
|
@ -15,12 +15,13 @@ export default c([
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
transition:
|
||||
fill .3s ${cubicBezierEaseInOut};
|
||||
fill: currentColor;
|
||||
`
|
||||
},
|
||||
[
|
||||
cM('color-transition', {
|
||||
transition: `color .3s ${cubicBezierEaseInOut}`
|
||||
}),
|
||||
c('svg', {
|
||||
height: '1em',
|
||||
width: '1em',
|
||||
|
Loading…
Reference in New Issue
Block a user