-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use MessageChannel for nextTick
- Loading branch information
Showing
5 changed files
with
113 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title></title> | ||
<script src="../../../dist/vue.min.js"></script> | ||
</head> | ||
<body> | ||
|
||
<!-- #4510 click and change event on checkbox --> | ||
<div id="case-1"> | ||
<div @click="num++"> | ||
{{ num }} | ||
<input type="checkbox" v-model="checked"> | ||
</div> | ||
</div> | ||
<script> | ||
var vm1 = new Vue({ | ||
el: '#case-1', | ||
data: { | ||
num: 1, | ||
checked: false | ||
} | ||
}) | ||
</script> | ||
|
||
<!-- #6566 click event bubbling --> | ||
<div id="case-2"> | ||
<div v-if="expand"> | ||
<button @click="expand = false, countA++">Expand is True</button> | ||
</div> | ||
<div class="header" v-if="!expand" @click="expand = true, countB++"> | ||
<button>Expand is False</button> | ||
</div> | ||
<div class="count-a"> | ||
countA: {{countA}} | ||
</div> | ||
<div class="count-b"> | ||
countB: {{countB}} | ||
</div> | ||
</div> | ||
<script> | ||
var vm2 = new Vue({ | ||
el: '#case-2', | ||
data: { | ||
expand: true, | ||
countA: 0, | ||
countB: 0, | ||
} | ||
}) | ||
</script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
module.exports = { | ||
'async edge cases': function (browser) { | ||
browser | ||
.url('http://localhost:8080/test/e2e/specs/async-edge-cases.html') | ||
// #4510 | ||
.assert.containsText('#case-1', '1') | ||
.assert.checked('#case-1 input', false) | ||
|
||
.click('#case-1 input') | ||
.assert.containsText('#case-1', '2') | ||
.assert.checked('#case-1 input', true) | ||
|
||
.click('#case-1 input') | ||
.assert.containsText('#case-1', '3') | ||
.assert.checked('#case-1 input', false) | ||
|
||
// #6566 | ||
.assert.containsText('#case-2 button', 'Expand is True') | ||
.assert.containsText('.count-a', 'countA: 0') | ||
.assert.containsText('.count-b', 'countB: 0') | ||
|
||
.click('#case-2 button') | ||
.assert.containsText('#case-2 button', 'Expand is False') | ||
.assert.containsText('.count-a', 'countA: 1') | ||
.assert.containsText('.count-b', 'countB: 0') | ||
|
||
.click('#case-2 button') | ||
.assert.containsText('#case-2 button', 'Expand is True') | ||
.assert.containsText('.count-a', 'countA: 1') | ||
.assert.containsText('.count-b', 'countB: 1') | ||
|
||
.end() | ||
} | ||
} |