mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-15 04:42:23 +08:00
fix(button): fix line height of icon to avoid outer attr
This commit is contained in:
parent
ad3840ddda
commit
a5c4a4050b
@ -11,7 +11,7 @@
|
||||
<n-button size="small">
|
||||
<template v-slot:icon>
|
||||
<n-nimbus-icon
|
||||
type="pull-request"
|
||||
type="share"
|
||||
color="#63E2B7"
|
||||
/>
|
||||
</template>
|
||||
@ -20,7 +20,7 @@
|
||||
<n-button>
|
||||
<template v-slot:icon>
|
||||
<n-nimbus-icon
|
||||
type="pull-request"
|
||||
type="share"
|
||||
color="#63E2B7"
|
||||
/>
|
||||
</template>
|
||||
@ -29,7 +29,7 @@
|
||||
<n-button size="tiny">
|
||||
<template v-slot:icon>
|
||||
<n-nimbus-icon
|
||||
type="pull-request"
|
||||
type="share"
|
||||
color="#63E2B7"
|
||||
/>
|
||||
</template>
|
||||
@ -38,7 +38,7 @@
|
||||
<n-button icon-on-right>
|
||||
<template v-slot:icon>
|
||||
<n-nimbus-icon
|
||||
type="pull-request"
|
||||
type="share"
|
||||
color="#63E2B7"
|
||||
/>
|
||||
</template>
|
||||
|
@ -8,7 +8,7 @@
|
||||
style="flex-wrap: nowrap;"
|
||||
>
|
||||
<!--EXAMPLE_START-->
|
||||
<n-steps :active="active">
|
||||
<n-steps :current="current">
|
||||
<n-step
|
||||
title="A B C D"
|
||||
description="Hello Go Go Go Go, Hello Go Go Go Go"
|
||||
@ -40,14 +40,14 @@ export default {
|
||||
data () {
|
||||
return {
|
||||
timerId: null,
|
||||
active: null
|
||||
current: null
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.timerId = window.setInterval(() => {
|
||||
if (this.active === null) this.active = 0
|
||||
else if (this.active >= 3) this.active = null
|
||||
else this.active++
|
||||
if (this.current === null) this.current = 0
|
||||
else if (this.current >= 3) this.current = null
|
||||
else this.current++
|
||||
}, 2000)
|
||||
},
|
||||
beforeDestroy () {
|
||||
|
@ -1,24 +1,24 @@
|
||||
<script>
|
||||
function wrapStep (step, i, active) {
|
||||
function wrapStep (step, i, current) {
|
||||
if (step.componentOptions.tag === 'n-step') {
|
||||
step.componentOptions.propsData = {
|
||||
...step.componentOptions.propsData,
|
||||
index: i + 1,
|
||||
finished: !!active && active > i,
|
||||
active: active === i
|
||||
finished: !!current && current > i,
|
||||
active: current === i
|
||||
}
|
||||
}
|
||||
return step
|
||||
}
|
||||
|
||||
function mapSteps (props, steps) {
|
||||
return steps.map((step, i) => wrapStep(step, i, props.active))
|
||||
return steps.map((step, i) => wrapStep(step, i, props.current))
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'NSteps',
|
||||
props: {
|
||||
active: {
|
||||
current: {
|
||||
type: Number,
|
||||
default: null,
|
||||
required: false
|
||||
|
@ -47,6 +47,7 @@
|
||||
.n-button__icon--slot {
|
||||
height: 14px;
|
||||
width: 14px;
|
||||
line-height: 14px;
|
||||
.n-icon-slot {
|
||||
height: 14px;
|
||||
width: 14px;
|
||||
@ -74,6 +75,7 @@
|
||||
}
|
||||
.n-button__icon--slot {
|
||||
height: 16px;
|
||||
line-height: 16px;
|
||||
width: 16px;
|
||||
.n-icon-slot {
|
||||
height: 16px;
|
||||
@ -101,6 +103,7 @@
|
||||
}
|
||||
.n-button__icon--slot {
|
||||
height: 18px;
|
||||
line-height: 18px;
|
||||
width: 18px;
|
||||
.n-icon-slot {
|
||||
height: 18px;
|
||||
@ -127,6 +130,7 @@
|
||||
}
|
||||
}
|
||||
.n-button__icon--slot {
|
||||
line-height: 18px;
|
||||
height: 18px;
|
||||
width: 18px;
|
||||
.n-icon-slot {
|
||||
|
Loading…
Reference in New Issue
Block a user