File tree Expand file tree Collapse file tree 1 file changed +46
-7
lines changed Expand file tree Collapse file tree 1 file changed +46
-7
lines changed Original file line number Diff line number Diff line change 11<template >
2- <span id =" github-btn" class =" github-btn" >
3- <a class =" gh-btn" href =" https://github.com/vueComponent/ant-design-vue" target =" _blank" >
4- <span class =" gh-ico" aria-hidden =" true" ></span >
5- <span class =" gh-text" >Star</span >
6- </a >
7- </span >
2+ <a-tooltip placement =" bottom" >
3+ <template #title >Github</template >
4+ <span id =" github-btn" class =" github-btn" :style =" githubIconStyles" >
5+ <a class =" gh-btn" href =" https://github.com/vueComponent/ant-design-vue" target =" _blank" >
6+ <GithubOutlined class =" github-icon" />
7+ </a >
8+ </span >
9+ </a-tooltip >
810</template >
11+
12+ <script lang="ts">
13+ import { defineComponent , inject , computed } from ' vue' ;
14+ import { GithubOutlined } from ' @ant-design/icons-vue' ;
15+ export default defineComponent ({
16+ components: {
17+ GithubOutlined ,
18+ },
19+ setup() {
20+ const themeMode = inject (' themeMode' );
21+ const githubIconStyles = computed (() => {
22+ let iconBackgroundColor = ' rgba(0,0,0,0.06)' ;
23+ if ((themeMode as any ).theme .value === ' dark' ) {
24+ iconBackgroundColor = ' rgba(255,255,255,0.12)' ;
25+ }
26+ return {
27+ ' --github-icon-background-color' : iconBackgroundColor ,
28+ };
29+ });
30+ return {
31+ githubIconStyles ,
32+ };
33+ },
34+ });
35+ </script >
36+
937<style lang="less" scoped>
1038@import ' ./Github.less' ;
1139#github-btn {
1442 height : auto ;
1543
1644 .gh-btn {
45+ color : currentColor ;
1746 height : auto ;
18- padding : 1 px 4 px ;
47+ padding : 6 px ;
1948 background : transparent ;
2049 border : 0 ;
50+ transition : all 0.2s ;
51+
52+ & :hover {
53+ background : var (--github-icon-background-color );
54+ }
2155
2256 .gh-ico {
2357 width : 20px ;
3064 }
3165 }
3266
67+ .github-icon {
68+ font-size : 18px ;
69+ color : var (--text-color );
70+ }
71+
3372 .gh-count {
3473 height : auto ;
3574 padding : 4px 8px ;
You can’t perform that action at this time.
0 commit comments