Skip to content

Commit

Permalink
feat: optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
XieZongChen committed Jul 27, 2021
1 parent f161df6 commit 7fb804a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
17 changes: 4 additions & 13 deletions src/input-number/src/InputNumber.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -371,12 +371,9 @@ export default defineComponent({
>
{{
prefix: this.$slots.prefix,
suffix: () =>
this.showButton ? (
[
<span
class={`${mergedClsPrefix}-input-number-suffix-has-button`}
>
suffix: this.showButton
? () => [
<span class={`${mergedClsPrefix}-input-number-suffix`}>
{{ default: this.$slots.suffix }}
</span>,
<NButton
Expand Down Expand Up @@ -416,13 +413,7 @@ export default defineComponent({
}}
</NButton>
]
) : (
<span
class={`${mergedClsPrefix}-input-number-suffix-no-button`}
>
{{ default: this.$slots.suffix }}
</span>
)
: this.$slots.suffix
}}
</NInput>
</div>
Expand Down
6 changes: 1 addition & 5 deletions src/input-number/src/styles/input-number.cssr.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import { cB, c } from '../../../_utils/cssr'

export default c([
cB('input-number-suffix-no-button', `
display: inline-block;
margin-right: 2px;
`),
cB('input-number-suffix-has-button', `
cB('input-number-suffix', `
display: inline-block;
margin-right: 10px;
`)
Expand Down

0 comments on commit 7fb804a

Please sign in to comment.