mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 14:13:37 +08:00
update require
This commit is contained in:
parent
a0f93bfa83
commit
f162e13d6b
@ -1,3 +1,10 @@
|
||||
window.require = function(path) {
|
||||
if (path in window) {
|
||||
return window[path];
|
||||
} else {
|
||||
throw 'There should not have modules here: ' + path;
|
||||
}
|
||||
};
|
||||
window['css-animation'] = require('css-animation');
|
||||
window['react-router'] = require('react-router');
|
||||
window.Clip = require('./clip');
|
||||
|
@ -46,29 +46,6 @@
|
||||
};
|
||||
</script>
|
||||
<script src="{{static_url('../dist/demo.js')}}"></script>
|
||||
<script>
|
||||
window.require = function (path) {
|
||||
var result = window;
|
||||
var namespaces = path.split('/');
|
||||
namespaces.forEach(function (key, i) {
|
||||
if (i === 2) {
|
||||
key = capitalizeFirstLetter(key);
|
||||
}
|
||||
if (key !== 'lib') {
|
||||
if (result[key]) {
|
||||
result = result[key];
|
||||
} else {
|
||||
throw 'There should not have modules here 2.';
|
||||
}
|
||||
}
|
||||
});
|
||||
function capitalizeFirstLetter(string) {
|
||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
</script>
|
||||
<script src="https://t.alipayobjects.com/images/T1DrxhXe0mXXXXXXXX.js"></script>
|
||||
{% block scripts %}{% endblock %}
|
||||
</head>
|
||||
|
Loading…
Reference in New Issue
Block a user