gpt4 book ai didi

css - 如何在 ExtJs 5 中添加自定义 CSS 文件?

转载 作者:太空宇宙 更新时间:2023-11-04 12:05:41 25 4
gpt4 key购买 nike

在 ExtJs 4 中,我包含了一个像这样的自定义 css:

<!-- <x-compile> -->
<!-- <x-bootstrap> -->
<link rel="stylesheet" href="bootstrap.css">
<script src="ext/ext-dev.js"></script>
<script src="bootstrap.js"></script>
<!-- </x-bootstrap> -->
<script src="app.js"></script>
<!-- </x-compile> -->
<link rel="stylesheet" href="/custom/css.css" type="text/css" charset="utf-8" />

CSS 链接位于 <x-compile> 之后的事实部分使其稍后加载,因此在 custom.css 中规则覆盖已编译的 extjs 主题 css 中的规则。

在 ExtJs 5.0 中,这不再有效。尽管在微加载器之后包含自定义 css,但主题 css 是在 custom.css 之后加载的。 :

<script id="microloader" type="text/javascript" src="bootstrap.js"></script>
<link rel="stylesheet" href="/custom/css.css" type="text/css" charset="utf-8" />

如何实现 custom.css最后加载是为了覆盖 ExtJs css 文件中的某些规则?

最佳答案

打开 app.json 并查找 css 属性。在那里添加你的文件,Sencha CMD 会将它与框架 CSS 捆绑在一起。默认的看起来像这样:

/**
* List of all CSS assets in the right inclusion order.
*
* Each item is an object with the following format:
*
* {
* // Path to file. If the file is local this must be a relative path from
* // this app.json file.
* //
* "path": "path/to/stylesheet.css", // REQUIRED
*
* // Specify as true if this file is remote and should not be copied into the
* // build folder. Defaults to false for a local file which will be copied.
* //
* "remote": false, // OPTIONAL
*
* // If not specified, this file will only be loaded once, and cached inside
* // localStorage until this value is changed. You can specify:
* //
* // - "delta" to enable over-the-air delta update for this file
* // - "full" means full update will be made when this file changes
* //
* "update": "" // OPTIONAL
* }
*/
"css": [
{
"path": "bootstrap.css",
"bootstrap": true
}
],

关于css - 如何在 ExtJs 5 中添加自定义 CSS 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29395640/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com