Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/platforms/web/runtime/class-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
export function addClass (el: Element, cls: ?string) {
/* istanbul ignore if */
if (!cls || !cls.trim()) {
if (!cls || !(cls = cls.trim())) {
return
}

Expand All @@ -31,7 +31,7 @@ export function addClass (el: Element, cls: ?string) {
*/
export function removeClass (el: Element, cls: ?string) {
/* istanbul ignore if */
if (!cls || !cls.trim()) {
if (!cls || !(cls = cls.trim())) {
return
}

Expand Down
6 changes: 3 additions & 3 deletions test/unit/features/transition/transition.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ if (!isIE9) {
enter-to-class="hello-to"
leave-class="bye"
leave-to-class="bye-to"
leave-active-class="byebye active">
leave-active-class="byebye active more ">
<div v-if="ok" class="test">foo</div>
</transition>
</div>
Expand All @@ -85,9 +85,9 @@ if (!isIE9) {
expect(vm.$el.innerHTML).toBe('<div class="test">foo</div>')
vm.ok = false
waitForUpdate(() => {
expect(vm.$el.children[0].className).toBe('test bye byebye active')
expect(vm.$el.children[0].className).toBe('test bye byebye active more')
}).thenWaitFor(nextFrame).then(() => {
expect(vm.$el.children[0].className).toBe('test byebye active bye-to')
expect(vm.$el.children[0].className).toBe('test byebye active more bye-to')
}).thenWaitFor(duration + buffer).then(() => {
expect(vm.$el.children.length).toBe(0)
vm.ok = true
Expand Down