Created
September 7, 2015 08:05
-
-
Save SiZapPaaiGwat/eed167de202f2f087c7c to your computer and use it in GitHub Desktop.
single file ractive component
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>ractive single file component demo</title> | |
</head> | |
<body> | |
<div id="a"> | |
</div> | |
<script type="text/x-handlebars-template" id="tpl"> | |
<ajaxButton url="./" data="" | |
text="确定" loadingText="正在提交..." disable="" className="btn btn-primary" | |
on-success="" on-error="" | |
/> | |
</script> | |
<script src="assets/js/require.js"></script> | |
<script> | |
require.config({ | |
baseUrl: './', | |
paths: { | |
ractive: 'http://cdn.bootcss.com/ractive/0.7.3/ractive', | |
component: '../../components' | |
} | |
}) | |
require(['ractive', 'rvc!component/ajax-button'], function(Ractive, ajaxButton) { | |
var app = new Ractive({ | |
el: '#a', | |
template: '#tpl', | |
components: { | |
ajaxButton: ajaxButton | |
} | |
}) | |
}) | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment