Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Element
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林焕东
Element
Commits
2bd5098b
Commit
2bd5098b
authored
Apr 30, 2019
by
iamkun
Committed by
hetech
Apr 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Chore: add theme (#15361)
parent
fa18e932
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
46 additions
and
28 deletions
+46
-28
examples/components/header.vue
examples/components/header.vue
+11
-16
examples/components/theme-configurator/index.vue
examples/components/theme-configurator/index.vue
+2
-0
examples/components/theme/components-preview.vue
examples/components/theme/components-preview.vue
+1
-1
examples/components/theme/theme-list.js
examples/components/theme/theme-list.js
+7
-5
examples/entry.js
examples/entry.js
+13
-0
examples/i18n/theme-editor.json
examples/i18n/theme-editor.json
+8
-4
examples/pages/template/theme.tpl
examples/pages/template/theme.tpl
+4
-2
No files found.
examples/components/header.vue
View file @
2bd5098b
...
@@ -303,7 +303,7 @@
...
@@ -303,7 +303,7 @@
</li>
</li>
<li
<li
class=
"nav-item"
class=
"nav-item"
v-if=
"
showThemeConfigurator
"
v-if=
"
$isEle
"
>
>
<router-link
<router-link
active-class=
"active"
active-class=
"active"
...
@@ -373,7 +373,7 @@
...
@@ -373,7 +373,7 @@
<!--theme picker-->
<!--theme picker-->
<li
class=
"nav-item nav-theme-switch"
v-show=
"isComponentPage"
>
<li
class=
"nav-item nav-theme-switch"
v-show=
"isComponentPage"
>
<theme-picker
v-if=
"!
showThemeConfigurator
"
></theme-picker>
<theme-picker
v-if=
"!
$isEle
"
></theme-picker>
</li>
</li>
</ul>
</ul>
</div>
</div>
...
@@ -405,8 +405,7 @@
...
@@ -405,8 +405,7 @@
'
en-US
'
:
'
English
'
,
'
en-US
'
:
'
English
'
,
'
es
'
:
'
Español
'
,
'
es
'
:
'
Español
'
,
'
fr-FR
'
:
'
Français
'
'
fr-FR
'
:
'
Français
'
},
}
showThemeConfigurator
:
false
};
};
},
},
...
@@ -432,18 +431,14 @@
...
@@ -432,18 +431,14 @@
}
}
},
},
mounted
()
{
mounted
()
{
const
host
=
location
.
hostname
;
getVars
()
this
.
showThemeConfigurator
=
host
.
match
(
'
localhost
'
)
||
host
.
match
(
'
elenet
'
);
.
then
(()
=>
{
if
(
!
this
.
showThemeConfigurator
)
{
this
.
$isEle
=
true
;
getVars
()
ga
(
'
send
'
,
'
event
'
,
'
DocView
'
,
'
Inner
'
);
.
then
(()
=>
{
})
this
.
showThemeConfigurator
=
true
;
.
catch
((
err
)
=>
{
ga
(
'
send
'
,
'
event
'
,
'
DocView
'
,
'
Inner
'
);
console
.
error
(
err
);
})
});
.
catch
((
err
)
=>
{
console
.
error
(
err
);
});
}
},
},
methods
:
{
methods
:
{
switchVersion
(
version
)
{
switchVersion
(
version
)
{
...
...
examples/components/theme-configurator/index.vue
View file @
2bd5098b
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
@
select=
"onSelectChange"
@
select=
"onSelectChange"
></action-panel>
></action-panel>
<main-panel
<main-panel
ref=
'configuratorMain'
v-if=
"defaultConfig"
v-if=
"defaultConfig"
:currentConfig=
"currentConfig"
:currentConfig=
"currentConfig"
:defaultConfig=
"defaultConfig"
:defaultConfig=
"defaultConfig"
...
@@ -179,6 +180,7 @@ export default {
...
@@ -179,6 +180,7 @@ export default {
bus
.
$emit
(
ACTION_COMPONECT_SELECT
,
val
);
bus
.
$emit
(
ACTION_COMPONECT_SELECT
,
val
);
this
.
selectedComponent
=
val
;
this
.
selectedComponent
=
val
;
this
.
filterCurrentConfig
();
this
.
filterCurrentConfig
();
this
.
$refs
.
configuratorMain
.
focus
();
}
}
},
},
watch
:
{
watch
:
{
...
...
examples/components/theme/components-preview.vue
View file @
2bd5098b
...
@@ -227,7 +227,7 @@
...
@@ -227,7 +227,7 @@
<div
role=
"alert"
class=
"demo-item el-message el-message--success el-message-fade-leave-active el-message-fade-leave-to"
style=
"top: 0;left: 0;width: 100px; opacity: 1; position: relative;transform: none;"
><i
class=
"el-message__icon el-icon-success"
></i><p
class=
"el-message__content"
>
Congrats, this is a success message.
</p>
<!---->
</div>
<div
role=
"alert"
class=
"demo-item el-message el-message--success el-message-fade-leave-active el-message-fade-leave-to"
style=
"top: 0;left: 0;width: 100px; opacity: 1; position: relative;transform: none;"
><i
class=
"el-message__icon el-icon-success"
></i><p
class=
"el-message__content"
>
Congrats, this is a success message.
</p>
<!---->
</div>
<div
role=
"alert"
class=
"demo-item el-message el-message--warning el-message-fade-leave-active el-message-fade-leave-to"
style=
"top: 0;left: 0;width: 100px; opacity: 1; position: relative;transform: none;"
><i
class=
"el-message__icon el-icon-warning"
></i><p
class=
"el-message__content"
>
Warning, this is a warning message.
</p>
<!---->
</div>
<div
role=
"alert"
class=
"demo-item el-message el-message--warning el-message-fade-leave-active el-message-fade-leave-to"
style=
"top: 0;left: 0;width: 100px; opacity: 1; position: relative;transform: none;"
><i
class=
"el-message__icon el-icon-warning"
></i><p
class=
"el-message__content"
>
Warning, this is a warning message.
</p>
<!---->
</div>
<div
role=
"alert"
class=
"demo-item el-message el-message--info el-message-fade-leave-active el-message-fade-leave-to"
style=
"top: 0;left: 0;width: 100px; opacity: 1; position: relative;transform: none;"
><i
class=
"el-message__icon el-icon-info"
></i><p
class=
"el-message__content"
>
This is a message.
</p>
<!---->
</div>
<div
role=
"alert"
class=
"demo-item el-message el-message--info el-message-fade-leave-active el-message-fade-leave-to"
style=
"top: 0;left: 0;width: 100px; opacity: 1; position: relative;transform: none;"
><i
class=
"el-message__icon el-icon-info"
></i><p
class=
"el-message__content"
>
This is a message.
</p>
<!---->
</div>
<div
role=
"alert"
class=
"demo-item el-message el-message--error
el-message-fade-leave-active el-message-fade-leave-to"
style=
"top: 0;left: 0;width: 100px; opacity: 1; position: relative;transform: none;"
><i
class=
"el-message__icon el-icon-error"
></i><p
class=
"el-message__content"
>
Oops, this is a error message.
</p>
<!----
>
</div>
<div
role=
"alert"
class=
"demo-item el-message el-message--error
is-closable el-message-fade-leave-active el-message-fade-leave-to"
style=
"top: 0;left: 0;width: 100px; opacity: 1; position: relative;transform: none;"
><i
class=
"el-message__icon el-icon-error"
></i><p
class=
"el-message__content"
>
Oops, this is a error message.
</p><i
class=
"el-message__closeBtn el-icon-close"
></i
></div>
</el-row>
</el-row>
<h4>
MessageBox
</h4>
<h4>
MessageBox
</h4>
<el-row>
<el-row>
...
...
examples/components/theme/theme-list.js
View file @
2bd5098b
const
themeList
=
[
export
const
themeList
=
[
{
{
name
:
'
Element
'
,
name
:
'
Element
'
,
author
:
'
Element
'
,
author
:
'
Element
'
,
theme
:
'
{"global":{"$--color-primary":"#409EFF"},"local":{}}
'
theme
:
'
{"global":{"$--color-primary":"#409EFF"},"local":{}}
'
},
}
];
export
const
eleThemeList
=
[
{
{
name
:
'
Napos
'
,
name
:
'
Kiwi
'
,
author
:
'
Element
'
,
author
:
'
Element
'
,
theme
:
'
{"global":{"$--color-primary":"#1989FA"
},"local":{
}}
'
theme
:
'
{"global":{"$--color-primary":"#1989FA"
,"$--color-success":"#5CB87A","$--color-warning":"#E6A23C","$--color-danger":"#F56C6C","$--color-info":"#8896B3","$--font-size-small":"13px","$--font-size-base":"14px","$--font-size-medium":"16px","$--font-size-large":"22px","$--font-size-extra-large":"28px","$--font-line-height-secondary":"20px"},"local":{"$--button-primary-background-color":"$--color-primary","$--switch-font-size":"14px","$--datepicker-active-color":"$--color-primary","$--tooltip-border-color":"$--border-color-base","$--tooltip-color":"#FFFFFF","$--tooltip-padding":"10px","$--collapse-header-font-size":"14px","$--collapse-content-font-size":"14px","$--collapse-content-font-color":"$--color-text-regular","$--radio-input-background-color":"#FFFFFF","$--radio-icon-color":"$--color-warning","$--radio-button-checked-background-color":"$--color-primary","$--input-border-radius":"$--border-radius-base","$--select-input-focus-border-color":"$--color-primary","$--select-font-size":"14px","$--select-option-selected-font-color":"$--color-primary","$--select-input-font-size":"14px","$--select-option-height":"34px","$--slider-main-background-color":"$--color-primary","$--tag-font-color":"$--color-primary","$--tag-default-hover-background-color":"$--color-primary","$--message-warning-font-color":"$--color-warning","$--alert-title-font-size":"14px","$--alert-icon-size":"14px","$--alert-icon-large-size":"22px","$--alert-close-customed-font-size":"12px","$--notification-title-font-size":"16px","$--notification-content-font-size":"14px","$--menu-item-font-color":"$--color-primary"
}}
'
}
}
];
];
export
default
themeList
;
examples/entry.js
View file @
2bd5098b
...
@@ -25,6 +25,19 @@ Vue.component('main-header', MainHeader);
...
@@ -25,6 +25,19 @@ Vue.component('main-header', MainHeader);
Vue
.
component
(
'
side-nav
'
,
SideNav
);
Vue
.
component
(
'
side-nav
'
,
SideNav
);
Vue
.
component
(
'
footer-nav
'
,
FooterNav
);
Vue
.
component
(
'
footer-nav
'
,
FooterNav
);
const
globalEle
=
new
Vue
({
data
:
{
$isEle
:
false
}
// 是否 ele 用户
});
Vue
.
mixin
({
computed
:
{
$isEle
:
{
get
:
()
=>
(
globalEle
.
$data
.
$isEle
),
set
:
(
data
)
=>
{
globalEle
.
$data
.
$isEle
=
data
;}
}
}
});
Vue
.
prototype
.
$icon
=
icon
;
// Icon 列表页用
Vue
.
prototype
.
$icon
=
icon
;
// Icon 列表页用
const
router
=
new
VueRouter
({
const
router
=
new
VueRouter
({
...
...
examples/i18n/theme-editor.json
View file @
2bd5098b
...
@@ -68,7 +68,8 @@
...
@@ -68,7 +68,8 @@
"theme-copy"
:
"复制"
,
"theme-copy"
:
"复制"
,
"theme-edit"
:
"编辑"
,
"theme-edit"
:
"编辑"
,
"description-element"
:
"默认主题"
,
"description-element"
:
"默认主题"
,
"description-napos"
:
"深色主题"
"description-napos"
:
"深色主题"
,
"description-kiwi"
:
"KIWI 主题"
},
},
"category"
:
{
"category"
:
{
"BrandColor"
:
"品牌颜色"
,
"BrandColor"
:
"品牌颜色"
,
...
@@ -195,7 +196,8 @@
...
@@ -195,7 +196,8 @@
"theme-copy"
:
"Copy"
,
"theme-copy"
:
"Copy"
,
"theme-edit"
:
"Edit"
,
"theme-edit"
:
"Edit"
,
"description-element"
:
"Default theme"
,
"description-element"
:
"Default theme"
,
"description-napos"
:
"Dark theme"
"description-napos"
:
"Dark theme"
,
"description-kiwi"
:
"kiwi theme"
},
},
"category"
:
{
"category"
:
{
"BrandColor"
:
"Brand Color"
,
"BrandColor"
:
"Brand Color"
,
...
@@ -276,7 +278,8 @@
...
@@ -276,7 +278,8 @@
"theme-copy"
:
"Copy"
,
"theme-copy"
:
"Copy"
,
"theme-edit"
:
"Edit"
,
"theme-edit"
:
"Edit"
,
"description-element"
:
"Default theme"
,
"description-element"
:
"Default theme"
,
"description-napos"
:
"Dark theme"
"description-napos"
:
"Dark theme"
,
"description-kiwi"
:
"kiwi theme"
},
},
"category"
:
{
"category"
:
{
"BrandColor"
:
"Brand Color"
,
"BrandColor"
:
"Brand Color"
,
...
@@ -357,7 +360,8 @@
...
@@ -357,7 +360,8 @@
"theme-copy"
:
"Copy"
,
"theme-copy"
:
"Copy"
,
"theme-edit"
:
"Edit"
,
"theme-edit"
:
"Edit"
,
"description-element"
:
"Default theme"
,
"description-element"
:
"Default theme"
,
"description-napos"
:
"Dark theme"
"description-napos"
:
"Dark theme"
,
"description-kiwi"
:
"kiwi theme"
},
},
"category"
:
{
"category"
:
{
"BrandColor"
:
"Brand Color"
,
"BrandColor"
:
"Brand Color"
,
...
...
examples/pages/template/theme.tpl
View file @
2bd5098b
...
@@ -81,7 +81,7 @@
...
@@ -81,7 +81,7 @@
</template>
</template>
<script>
<script>
import
ThemeCard
from
'
../../components/theme/theme-card.vue
'
;
import
ThemeCard
from
'
../../components/theme/theme-card.vue
'
;
import
ThemeList
from
'
../../components/theme/theme-list.js
'
;
import
{
themeList
,
eleThemeList
}
from
'
../../components/theme/theme-list.js
'
;
import
{
saveUserThemeToLocal
,
loadUserThemeFromLocal
}
from
'
../../components/theme/localstorage
'
;
import
{
saveUserThemeToLocal
,
loadUserThemeFromLocal
}
from
'
../../components/theme/localstorage
'
;
import
{
getActionDisplayName
}
from
'
../../components/theme-configurator/utils/utils
'
;
import
{
getActionDisplayName
}
from
'
../../components/theme-configurator/utils/utils
'
;
...
@@ -100,7 +100,6 @@ export default {
...
@@ -100,7 +100,6 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
officialTheme
:
this
.
padEmpeyTheme
(
ThemeList
),
userTheme
:
[],
userTheme
:
[],
maxUserTheme
,
maxUserTheme
,
copyDialogVisible
:
false
,
copyDialogVisible
:
false
,
...
@@ -114,6 +113,9 @@ export default {
...
@@ -114,6 +113,9 @@ export default {
};
};
},
},
computed
:
{
computed
:
{
officialTheme
()
{
return
this
.
padEmpeyTheme
(
themeList
.
concat
(
this
.
$isEle
?
eleThemeList
:
[]));
},
userThemeCount
()
{
userThemeCount
()
{
return
this
.
userTheme
.
length
;
return
this
.
userTheme
.
length
;
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment