@@ -15,7 +15,7 @@ import { ElMessage } from 'element-plus';
1515})
1616export default class ReleaseItem extends Vue {
1717 @Prop ({ type: String , required: true }) platform! : string ;
18- @Prop ({ type: String , default: ' 1.0.0-beta.1 ' }) version! : string ;
18+ @Prop ({ type: String , required: true }) version! : string ;
1919
2020 get platformImage(): string {
2121 switch (this .platform ) {
@@ -34,38 +34,39 @@ export default class ReleaseItem extends Vue {
3434 }
3535
3636 get downloadLink(): string {
37- const version = this .version || ' 1.0.0-beta.1' ;
38- const downloadLink = new ReleasesConfig (version ).downloadSingleSystemLink (this .platform , this .defaultArch );
37+ const downloadLink = new ReleasesConfig (this .version ).downloadSingleSystemLink (
38+ this .platform ,
39+ this .defaultArch ,
40+ );
3941 return downloadLink ;
4042 }
4143
4244 get otherLinks(): Array <{ arch: string ; name? : string ; link: string }> {
43- const version = this .version || ' 1.0.0-beta.1' ;
4445 switch (this .platform ) {
4546 case ' windows' :
4647 return [
4748 {
4849 arch: ' x64' ,
4950 name: ' Windows (x64)' ,
50- link: new ReleasesConfig (version ).downloadSingleSystemLink (' windows' , ' x64' ),
51+ link: new ReleasesConfig (this . version ).downloadSingleSystemLink (' windows' , ' x64' ),
5152 },
5253 {
5354 arch: ' Arm64' ,
5455 name: ' Windows (Arm64)' ,
55- link: new ReleasesConfig (version ).downloadSingleSystemLink (' windows' , ' arm64' ),
56+ link: new ReleasesConfig (this . version ).downloadSingleSystemLink (' windows' , ' arm64' ),
5657 },
5758 ];
5859 case ' mac' :
5960 return [
6061 {
6162 arch: ' Intel Chip' ,
6263 name: ' macOS (Intel Chip)' ,
63- link: new ReleasesConfig (version ).downloadSingleSystemLink (' mac' , ' x64' ),
64+ link: new ReleasesConfig (this . version ).downloadSingleSystemLink (' mac' , ' x64' ),
6465 },
6566 {
6667 arch: ' Apple Silicon' ,
6768 name: ' macOS (Apple Silicon)' ,
68- link: new ReleasesConfig (version ).downloadSingleSystemLink (' mac' , ' arm64' ),
69+ link: new ReleasesConfig (this . version ).downloadSingleSystemLink (' mac' , ' arm64' ),
6970 },
7071 ];
7172 default :
@@ -75,12 +76,11 @@ export default class ReleaseItem extends Vue {
7576
7677 // SSR 安全的描述文本
7778 get staticAsideDesc(): string | null {
78- const version = this .version || ' 1.0.0-beta.1' ;
7979 switch (this .platform ) {
8080 case ' windows' :
81- return ` version ${version } for x64 ` ;
81+ return ` version ${this . version } for x64 ` ;
8282 case ' mac' :
83- return ` version ${version } for Intel Chip ` ;
83+ return ` version ${this . version } for Intel Chip ` ;
8484 default :
8585 return null ;
8686 }
@@ -98,15 +98,14 @@ export default class ReleaseItem extends Vue {
9898
9999 get dynamicAsideDesc(): string | null {
100100 const arch = this .clientArch ;
101- const version = this .version || ' 1.0.0-beta.1' ;
102101 switch (this .platform ) {
103102 case ' windows' :
104- return ` version ${version } for ${arch == ' arm64' ? ' Arm64' : arch } ` ;
103+ return ` version ${this . version } for ${arch == ' arm64' ? ' Arm64' : arch } ` ;
105104 case ' mac' :
106105 if (arch == ' arm64' ) {
107- return ` version ${version } for Apple Silicon ` ;
106+ return ` version ${this . version } for Apple Silicon ` ;
108107 } else {
109- return ` version ${version } for Intel Chip ` ;
108+ return ` version ${this . version } for Intel Chip ` ;
110109 }
111110 default :
112111 return null ;
@@ -134,9 +133,9 @@ export default class ReleaseItem extends Vue {
134133 </client-only >
135134 <main >
136135 <ClientOnly >
137- <DownloadButton :platform =" this.platform" :arch =" this.arch" />
136+ <DownloadButton :platform =" this.platform" :arch =" this.arch" :version = " this.version " />
138137 <template #fallback >
139- <DownloadButton :platform =" this.platform" :arch =" defaultArch" />
138+ <DownloadButton :platform =" this.platform" :arch =" defaultArch" :version = " this.version " />
140139 </template >
141140 </ClientOnly >
142141 </main >
0 commit comments