Theme: Refine GA track & Update footer link forward to online theme roller (#16007)

pull/16185/head
Zhi Cun 2019-06-11 19:35:43 +08:00 committed by island205
parent b4c2570387
commit 67d4c9ee9e
7 changed files with 27 additions and 28 deletions

View File

@ -7,8 +7,7 @@
<a href="https://github.com/ElemeFE/element/releases" class="footer-main-link" target="_blank">{{ langConfig.changelog }}</a> <a href="https://github.com/ElemeFE/element/releases" class="footer-main-link" target="_blank">{{ langConfig.changelog }}</a>
<a href="https://github.com/ElemeFE/element/blob/dev/FAQ.md" class="footer-main-link" target="_blank">{{ langConfig.faq }}</a> <a href="https://github.com/ElemeFE/element/blob/dev/FAQ.md" class="footer-main-link" target="_blank">{{ langConfig.faq }}</a>
<a href="https://github.com/ElementUI/element-starter" class="footer-main-link" target="_blank">{{ langConfig.starter }}</a> <a href="https://github.com/ElementUI/element-starter" class="footer-main-link" target="_blank">{{ langConfig.starter }}</a>
<a href="https://github.com/ElementUI/element-theme" class="footer-main-link" target="_blank">{{ langConfig.theme }}</a> <a :href="'/#/' + lang + '/component/custom-theme'" class="footer-main-link" target="_blank">{{ langConfig.theme }}</a>
<a href="https://github.com/ElementUI/theme-chalk-preview" class="footer-main-link" target="_blank">{{ langConfig.preview }}</a>
<a href="https://github.com/elemefe/element-react" class="footer-main-link" target="_blank">Element-React</a> <a href="https://github.com/elemefe/element-react" class="footer-main-link" target="_blank">Element-React</a>
<a href="https://github.com/ElemeFE/element-angular" class="footer-main-link" target="_blank">Element-Angular</a> <a href="https://github.com/ElemeFE/element-angular" class="footer-main-link" target="_blank">Element-Angular</a>
</div> </div>

View File

@ -48,6 +48,7 @@ import {
export default { export default {
props: { props: {
themeConfig: Object, themeConfig: Object,
previewConfig: Object,
isOfficial: Boolean, isOfficial: Boolean,
onUserConfigUpdate: Function onUserConfigUpdate: Function
}, },
@ -155,7 +156,7 @@ export default {
this.onAction(); this.onAction();
}, },
onDownload() { onDownload() {
bus.$emit(ACTION_DOWNLOAD_THEME, this.userConfig); bus.$emit(ACTION_DOWNLOAD_THEME, this.userConfig, this.previewConfig.name);
}, },
onAction() { onAction() {
this.onUserConfigUpdate(this.userConfig); this.onUserConfigUpdate(this.userConfig);

View File

@ -23,8 +23,8 @@ export default {
this.userConfig = val; this.userConfig = val;
this.onAction(); this.onAction();
}); });
bus.$on(ACTION_DOWNLOAD_THEME, val => { bus.$on(ACTION_DOWNLOAD_THEME, (themeConfig, themeName) => {
this.onDownload(val); this.onDownload(themeConfig, themeName);
}); });
}, },
data() { data() {
@ -41,7 +41,7 @@ export default {
}); });
this.lastApply = time; this.lastApply = time;
}, },
onDownload(themeConfig) { onDownload(themeConfig, themeName) {
this.triggertProgressBar(true); this.triggertProgressBar(true);
updateVars( updateVars(
Object.assign({}, themeConfig, { download: true }), Object.assign({}, themeConfig, { download: true }),
@ -55,7 +55,7 @@ export default {
.then(() => { .then(() => {
this.triggertProgressBar(false); this.triggertProgressBar(false);
}); });
ga('send', 'event', 'ThemeConfigurator', 'Download'); ga('send', 'event', 'ThemeConfigurator', 'Download', themeName);
}, },
onAction() { onAction() {
this.triggertProgressBar(true); this.triggertProgressBar(true);

View File

@ -325,7 +325,7 @@ export default {
}); });
break; break;
case 'download': case 'download':
bus.$emit(ACTION_DOWNLOAD_THEME, this.theme); bus.$emit(ACTION_DOWNLOAD_THEME, this.theme, this.config.name);
break; break;
default: default:
this.$emit('action', e, this.config); this.$emit('action', e, this.config);

View File

@ -12,8 +12,7 @@
"repo": "代码仓库", "repo": "代码仓库",
"community": "社区", "community": "社区",
"changelog": "更新日志", "changelog": "更新日志",
"theme": "自定义主题工具", "theme": "在线主题生成器",
"preview": "在线主题生成",
"faq": "常见问题", "faq": "常见问题",
"gitter": "在线讨论", "gitter": "在线讨论",
"starter": "脚手架", "starter": "脚手架",
@ -44,8 +43,7 @@
"repo": "GitHub", "repo": "GitHub",
"community": "Community", "community": "Community",
"changelog": "Changelog", "changelog": "Changelog",
"theme": "Theme CLI tool", "theme": "Online Theme Roller",
"preview": "Online theme generator",
"faq": "FAQ", "faq": "FAQ",
"gitter": "Gitter", "gitter": "Gitter",
"starter": "Starter kit", "starter": "Starter kit",
@ -76,8 +74,7 @@
"repo": "GitHub", "repo": "GitHub",
"community": "Comunidad", "community": "Comunidad",
"changelog": "Lista de cambios", "changelog": "Lista de cambios",
"theme": "Generador de temas por CLI", "theme": "Online Theme Roller",
"preview": "Generador de temas en línea",
"faq": "FAQ", "faq": "FAQ",
"gitter": "Gitter", "gitter": "Gitter",
"starter": "Kit de inicio", "starter": "Kit de inicio",
@ -108,8 +105,7 @@
"repo": "GitHub", "repo": "GitHub",
"community": "Communauté", "community": "Communauté",
"changelog": "Changelog", "changelog": "Changelog",
"theme": "Générateur de thème (CLI)", "theme": "Online Theme Roller",
"preview": "Générateur de thème en ligne",
"faq": "FAQ", "faq": "FAQ",
"gitter": "Gitter", "gitter": "Gitter",
"starter": "Kit de démarrage", "starter": "Kit de démarrage",

View File

@ -37,6 +37,8 @@
}); });
</script><% } %> </script><% } %>
<% if (process.env.NODE_ENV !== 'production') { %><script> <% if (process.env.NODE_ENV !== 'production') { %><script>
var ga = function() {}; var ga = function() {
console.log(arguments)
};
</script><% } %> </script><% } %>
</html> </html>

View File

@ -45,6 +45,7 @@
<theme-configurator <theme-configurator
:isOfficial="isOfficial" :isOfficial="isOfficial"
:themeConfig="themeConfig" :themeConfig="themeConfig"
:previewConfig="previewConfig"
:onUserConfigUpdate="onUserConfigUpdate" :onUserConfigUpdate="onUserConfigUpdate"
> >
</theme-configurator> </theme-configurator>