Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(ui/counter&slider): add class&call #382

Merged
merged 10 commits into from
Apr 4, 2022
Merged

perf(ui/counter&slider): add class&call #382

merged 10 commits into from
Apr 4, 2022

Conversation

liangle
Copy link
Contributor

@liangle liangle commented Apr 4, 2022

Checklist


  • Fix linting errors
  • Tests have been added / updated (or snapshots)

Change information


@github-actions
Copy link

github-actions bot commented Apr 4, 2022

@@ -1,16 +1,14 @@
<template>
<div class="var-counter var--box">
<div :class="[n(), 'var--box']">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

多个类名使用classes函数,下面的请同步修改

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已按要求改好啦哈

@codecov-commenter
Copy link

Codecov Report

Merging #382 (45f9f8b) into dev (cfd23a3) will increase coverage by 0.03%.
The diff coverage is 86.66%.

@@            Coverage Diff             @@
##              dev     #382      +/-   ##
==========================================
+ Coverage   96.39%   96.43%   +0.03%     
==========================================
  Files         209      209              
  Lines        4911     4961      +50     
  Branches     1034     1003      -31     
==========================================
+ Hits         4734     4784      +50     
+ Misses        177      173       -4     
- Partials        0        4       +4     
Impacted Files Coverage Δ
packages/varlet-ui/src/counter/Counter.vue 96.85% <71.42%> (+0.02%) ⬆️
packages/varlet-ui/src/slider/Slider.vue 100.00% <100.00%> (ø)
packages/varlet-ui/src/col/Col.vue 100.00% <0.00%> (ø)
packages/varlet-ui/src/row/Row.vue 100.00% <0.00%> (ø)
packages/varlet-ui/src/cell/Cell.vue 100.00% <0.00%> (ø)
packages/varlet-ui/src/form/Form.vue 100.00% <0.00%> (ø)
packages/varlet-ui/src/icon/Icon.vue 100.00% <0.00%> (ø)
packages/varlet-ui/src/list/List.vue 100.00% <0.00%> (ø)
packages/varlet-ui/src/rate/Rate.vue 100.00% <0.00%> (ø)
packages/varlet-ui/src/image/Image.vue 100.00% <0.00%> (ø)
... and 21 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cfd23a3...45f9f8b. Read the comment docs.

<div
class="var-counter__controller var-elevation--2"
:class="[disabled || formDisabled ? 'var-counter--disabled' : null, errorMessage ? 'var-counter--error' : null]"
:class="classes(n('controller'), 'var-elevation--2', disabled || formDisabled ? n('--disabled') : null, errorMessage ? n('--error') : null)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

条件判断的话使用数组 如

:class="classes(
  n('controller'), 
  'var-elevation--2', 
  [disabled || formDisabled, n('--disabled')],
  [errorMessage, n('--error')]
)"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我狠狠得改!

@BeADre
Copy link
Member

BeADre commented Apr 4, 2022

nice!

@BeADre BeADre merged commit 3277814 into varletjs:dev Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants