Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Extjs4 如何确定重置CSS的范围,以便使用scopeResetCSS属性将其应用于Ext组件?_Extjs4 - Fatal编程技术网

Extjs4 如何确定重置CSS的范围,以便使用scopeResetCSS属性将其应用于Ext组件?

Extjs4 如何确定重置CSS的范围,以便使用scopeResetCSS属性将其应用于Ext组件?,extjs4,Extjs4,如何将ExtCSS设置为仅应用于Ext组件 这是scopeResetCSS的Ext文档中提到的内容: scopeResetCSS : Boolean True to scope the reset CSS to be just applied to Ext components. Note that this wraps root containers with an additional element. Also remember that when you turn on this o

如何将ExtCSS设置为仅应用于Ext组件

这是
scopeResetCSS
的Ext文档中提到的内容:

scopeResetCSS : Boolean
True to scope the reset CSS to be just applied to Ext components. 
Note that this wraps root containers with an additional element. 
Also remember that when you turn on this option, you have to use ext-all-scoped 
{ unless you use the bootstrap.js to load your javascript, in which case it will be 
handled for you.

我已经设置了
Ext.scopeResetCSS=true
&还将
ext all.css
替换为
ext all scoped.css
,但这没有帮助。

感谢Donald Sipe在他的文章中发布了解决方案

在通过
Ext debug.js
script加载Ext对象之前,应按以下方式创建Ext对象:

 <script>
    // Here we define Ext for the first time
    Ext = {
        buildSettings:{
            "scopeResetCSS": true  // Thanks, but I'll do my own scoping please
        }
    };
</script>
<script src="js/libs/ext/4.0.2a/ext-all-debug.js"></script>

//这里我们首次定义了Ext
分机={
构建设置:{
“scopeResetCSS”:正确//谢谢,但我会自己确定范围
}
};

通过在
buildSettings
config对象中设置
scopeResetCSS
值,您告诉ExtJS您将自己处理CSS作用域。例如,要获得灰色主题的作用域版本:

  • 安装

  • 然后,在命令行上,移动到ExtJs Sass文件夹,例如
    /ExtJs/resources/Sass

  • 复制文件
    ext all gray.scss

  • 添加行
    $scope reset css:true位于文件顶部

  • 然后运行:
    compass compile ext all gray scoped.scss

    这将在css文件夹中创建一个文件
    ext all gray scoped.css
    ,您现在可以使用它