-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
将onXxx的初始化侦听执行延后,到@Bind侦听之后
- Loading branch information
Showing
8 changed files
with
90 additions
and
43 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
Large diffs are not rendered by default.
Oops, something went wrong.
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,16 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"/> | ||
<title>test</title> | ||
</head> | ||
<body> | ||
<div id="test"></div> | ||
<div id="test2"></div> | ||
<script src="../../demo/es5-shim.js"></script> | ||
<script src="../../demo/es5-sham.js"></script> | ||
<script src="../../demo/migi-es6-shim.js"></script> | ||
<script src="../../dist/index.js"></script> | ||
<script src="script.js"></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,20 @@ | ||
class Component extends migi.Component { | ||
constructor(...data) { | ||
super(...data); | ||
this.a = 1; | ||
} | ||
@bind a | ||
input() { | ||
document.querySelector('#test2').innerHTML = this.a; | ||
} | ||
render() { | ||
return <div> | ||
<input value={ this.a } onInput={ this.input }/> | ||
</div>; | ||
} | ||
} | ||
|
||
migi.render( | ||
<Component/>, | ||
'#test' | ||
); |
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,17 @@ | ||
var path = require('path'); | ||
var fs = require('fs'); | ||
|
||
module.exports = { | ||
'init': function(browser) { | ||
browser | ||
.url('file://' + path.join(__dirname, 'index.html')) | ||
.waitForElementVisible('body', 1000) | ||
.assert.elementPresent('#test2'); | ||
}, | ||
'input': function(browser) { | ||
browser | ||
.setValue('input', 'a') | ||
.assert.containsText('#test2', '1a') | ||
.end(); | ||
}, | ||
}; |
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