@@ -15,7 +15,7 @@ import { ElMessage } from 'element-plus';
15
15
})
16
16
export default class ReleaseItem extends Vue {
17
17
@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 ;
19
19
20
20
get platformImage(): string {
21
21
switch (this .platform ) {
@@ -34,38 +34,39 @@ export default class ReleaseItem extends Vue {
34
34
}
35
35
36
36
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
+ );
39
41
return downloadLink ;
40
42
}
41
43
42
44
get otherLinks(): Array <{ arch: string ; name? : string ; link: string }> {
43
- const version = this .version || ' 1.0.0-beta.1' ;
44
45
switch (this .platform ) {
45
46
case ' windows' :
46
47
return [
47
48
{
48
49
arch: ' x64' ,
49
50
name: ' Windows (x64)' ,
50
- link: new ReleasesConfig (version ).downloadSingleSystemLink (' windows' , ' x64' ),
51
+ link: new ReleasesConfig (this . version ).downloadSingleSystemLink (' windows' , ' x64' ),
51
52
},
52
53
{
53
54
arch: ' Arm64' ,
54
55
name: ' Windows (Arm64)' ,
55
- link: new ReleasesConfig (version ).downloadSingleSystemLink (' windows' , ' arm64' ),
56
+ link: new ReleasesConfig (this . version ).downloadSingleSystemLink (' windows' , ' arm64' ),
56
57
},
57
58
];
58
59
case ' mac' :
59
60
return [
60
61
{
61
62
arch: ' Intel Chip' ,
62
63
name: ' macOS (Intel Chip)' ,
63
- link: new ReleasesConfig (version ).downloadSingleSystemLink (' mac' , ' x64' ),
64
+ link: new ReleasesConfig (this . version ).downloadSingleSystemLink (' mac' , ' x64' ),
64
65
},
65
66
{
66
67
arch: ' Apple Silicon' ,
67
68
name: ' macOS (Apple Silicon)' ,
68
- link: new ReleasesConfig (version ).downloadSingleSystemLink (' mac' , ' arm64' ),
69
+ link: new ReleasesConfig (this . version ).downloadSingleSystemLink (' mac' , ' arm64' ),
69
70
},
70
71
];
71
72
default :
@@ -75,12 +76,11 @@ export default class ReleaseItem extends Vue {
75
76
76
77
// SSR 安全的描述文本
77
78
get staticAsideDesc(): string | null {
78
- const version = this .version || ' 1.0.0-beta.1' ;
79
79
switch (this .platform ) {
80
80
case ' windows' :
81
- return ` version ${version } for x64 ` ;
81
+ return ` version ${this . version } for x64 ` ;
82
82
case ' mac' :
83
- return ` version ${version } for Intel Chip ` ;
83
+ return ` version ${this . version } for Intel Chip ` ;
84
84
default :
85
85
return null ;
86
86
}
@@ -98,15 +98,14 @@ export default class ReleaseItem extends Vue {
98
98
99
99
get dynamicAsideDesc(): string | null {
100
100
const arch = this .clientArch ;
101
- const version = this .version || ' 1.0.0-beta.1' ;
102
101
switch (this .platform ) {
103
102
case ' windows' :
104
- return ` version ${version } for ${arch == ' arm64' ? ' Arm64' : arch } ` ;
103
+ return ` version ${this . version } for ${arch == ' arm64' ? ' Arm64' : arch } ` ;
105
104
case ' mac' :
106
105
if (arch == ' arm64' ) {
107
- return ` version ${version } for Apple Silicon ` ;
106
+ return ` version ${this . version } for Apple Silicon ` ;
108
107
} else {
109
- return ` version ${version } for Intel Chip ` ;
108
+ return ` version ${this . version } for Intel Chip ` ;
110
109
}
111
110
default :
112
111
return null ;
@@ -134,9 +133,9 @@ export default class ReleaseItem extends Vue {
134
133
</client-only >
135
134
<main >
136
135
<ClientOnly >
137
- <DownloadButton :platform =" this.platform" :arch =" this.arch" />
136
+ <DownloadButton :platform =" this.platform" :arch =" this.arch" :version = " this.version " />
138
137
<template #fallback >
139
- <DownloadButton :platform =" this.platform" :arch =" defaultArch" />
138
+ <DownloadButton :platform =" this.platform" :arch =" defaultArch" :version = " this.version " />
140
139
</template >
141
140
</ClientOnly >
142
141
</main >
0 commit comments