"builds": {
"classic": {
"theme": "theme-classic"
},
"gray" : {
"theme" : "theme-gray"
},
"aria": {
"theme": "theme-aria"
},
"neptune" : {
"theme": "theme-neptune"
},
"crisp" :{
"theme": "theme-crisp"
},
"triton": {
"theme": "theme-triton"
}
},
"bootstrap": {
"base": "${app.dir}",
"microloader": "bootstrap.js",
"manifest": "${build.id}.json",
"css": "bootstrap.css"
}, 在output配置项中加入resources配置 "output": {
"base": "${workspace.build.dir}/${build.environment}/${app.name}",
"appCache": {
"enable": false
},
"resources": {
"path": "${build.id}/resources",
"shared": "resources"
}
},
修改好以上三项后,保存app.json。然后用 sencha app build development
来重新生成开发环境。编译完成后,会发现在build/development/app 目录下多出来一些文件夹,这些文件夹分别是各种Theme的资源文件;在WebContent下面也多出了相应的Theme的配置文件,如triton.json、neptune.json等,如下图:<!DOCTYPE HTML>
<html manifest="">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>app</title>
<script type="text/javascript">
var Ext = Ext || {};
Ext.beforeLoad = function(tags) {
var theme = location.href.match(/theme=([\w-]+)/);
theme = (theme && theme[1]) || 'crisp';
console.log('加载系统主题方案:' + theme);
Ext.manifest = theme + '.json';
};
</script>
<script id="microloader" data-app="e8b92f93-ab34-4781-ab41-b4b0f2a7d2c0"
type="text/javascript" src="bootstrap.js"></script>
</head>
<body></body>
</html>
版权声明:本文为博主原创文章,未经博主允许不得转载。
常规功能和模块自定义系统 (cfcmms)—013给Extjs6加入多界面主题(Theme)
原文:http://blog.csdn.net/jfok/article/details/49446195