提交 f162e13d 编写于 作者: A afc163

update require

上级 a0f93bfa
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>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册