mirror of
https://github.com/element-plus/element-plus.git
synced 2025-02-23 11:59:34 +08:00
fix(components): [el-switch] increase the word count of (in)active-text (#6140)
* fix(components): [el-switch] increase the word count of (in)active-text * Update packages/components/switch/src/switch.vue Co-authored-by: btea <2356281422@qq.com> * Update switch.vue Co-authored-by: btea <2356281422@qq.com>
This commit is contained in:
parent
46dfd1588e
commit
98b901c221
@ -49,7 +49,7 @@ describe('Switch.vue', () => {
|
||||
expect(coreEl.style.backgroundColor).toEqual('rgb(255, 0, 0)')
|
||||
expect(coreEl.style.width).toEqual('100px')
|
||||
const leftLabelWrapper = wrapper.find('.el-switch__inner span')
|
||||
expect(leftLabelWrapper.text()).toEqual('o')
|
||||
expect(leftLabelWrapper.text()).toEqual('on')
|
||||
})
|
||||
|
||||
test('switch with icons', () => {
|
||||
|
@ -57,14 +57,14 @@
|
||||
:class="[ns.is('text'), checked ? ns.is('show') : ns.is('hide')]"
|
||||
:aria-hidden="!checked"
|
||||
>
|
||||
{{ activeText.substr(0, 1) }}
|
||||
{{ activeText.substring(0, 3) }}
|
||||
</span>
|
||||
<span
|
||||
v-if="inactiveText"
|
||||
:class="[ns.is('text'), !checked ? ns.is('show') : ns.is('hide')]"
|
||||
:aria-hidden="checked"
|
||||
>
|
||||
{{ inactiveText.substr(0, 1) }}
|
||||
{{ inactiveText.substring(0, 3) }}
|
||||
</span>
|
||||
</template>
|
||||
</div>
|
||||
|
@ -112,6 +112,7 @@ $switch-font-size: map.merge(
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
left: 50%;
|
||||
white-space: nowrap;
|
||||
|
||||
.is-icon,
|
||||
.is-text {
|
||||
@ -170,6 +171,7 @@ $switch-font-size: map.merge(
|
||||
|
||||
.#{$namespace}-switch__inner {
|
||||
left: 50%;
|
||||
white-space: nowrap;
|
||||
margin-left: calc(-1px - var(--el-switch-button-size));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user