2016-06-07 111 views
0

我遵循ExtJS6主題指南並在面板上創建我的第一個mixin。 我在packages/local/my-classic-theme2/sass/var/panel/Panel.scss中創建了一個主題。 當我運行時面板未被更改,並且出現以下錯誤。在panel.scss中,它表示未聲明的mixin。在畫面enter image description hereextjs6主題指導 - 混音不被識別

煎茶應用中觀看錯誤我錯過了一步?

@include extjs-panel-ui(
$ui: 'highlight-framed', 
$ui-header-background-color: red, 
$ui-border-color: red, 
$ui-header-border-color: red, 
$ui-body-border-color: red, 
$ui-border-width: 5px, 
$ui-border-radius: 5px, 
$ui-header-color: white 

);

,我把這個實際的面板

ui: 'highlight', 
frame: true, 
+0

肯定做了些什麼......面板標題變小了,但一切仍然是默認的藍色。即使我說紅色。有原因嗎? (我把上面的mixin) – solarissf

回答

1

這裏的是我做過什麼:

創建一個新的應用程序使用下面的命令

sencha -sdk <path to ext 6.0.2> generate app -ext MyApp MyTestApp

cd MyTestApp

sencha generate theme --extend theme-classic my-classic-theme2

packages/local/my-classic-theme2/sass/src的內部創建了文件夾panel,並在該文件夾內創建了一個文件Panel.scss

編輯該文件並粘貼您的代碼是:

@include extjs-panel-ui(
    $ui: 'highlight-framed', 
    $ui-header-background-color: red, 
    $ui-border-color: red, 
    $ui-header-border-color: red, 
    $ui-body-border-color: red, 
    $ui-border-width: 5px, 
    $ui-border-radius: 5px, 
    $ui-header-color: white 
); 

編輯的classic/src/view/main/Main.js文件,並替換的項目與此塊:

items: [{ 
    title: 'Home', 
    iconCls: 'fa-home', 
    // The following grid shares a store with the classic version's grid as well! 
    items: [{ 
     xtype: 'mainlist' 
    }] 
}, { 
    title: 'Users', 
    iconCls: 'fa-user', 
    items : [{ 
     xtype: 'panel', 
     frame: true, 
     ui: 'highlight', 
     title: 'Testing my highlight panel', 
     items: [{ 
      xtype: 'textfield', 
      fieldLabel: 'Foo', 
      value: 'Bar' 
     }] 
    }] 
}] 

最後編輯app.json並確保我"theme"是指向my-classic-theme2

sencha app watch並去了http://localhost:1841

我的用戶選項卡以紅色標題顯示面板。

highlight ui