Replace constructor to computed property
This commit is contained in:
parent
502f3d4a69
commit
1bdf769b4e
|
@ -64,12 +64,7 @@ interface TheDeskInfo {
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
export default class About extends Vue {
|
export default class About extends Vue {
|
||||||
public productName: string
|
private thedeskInfo: TheDeskInfo = ipcRenderer.sendSync('thedesk-info')
|
||||||
public author: Maintainer
|
|
||||||
public contributors: Maintainer[]
|
|
||||||
public homePage: string
|
|
||||||
public copyrightYear: string
|
|
||||||
public versions: Versions
|
|
||||||
|
|
||||||
public get ctrHtml(): string {
|
public get ctrHtml(): string {
|
||||||
return this.contributors.map(contributer => {
|
return this.contributors.map(contributer => {
|
||||||
|
@ -77,20 +72,28 @@ export default class About extends Vue {
|
||||||
}).join(', ')
|
}).join(', ')
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor() {
|
public get productName(): string {
|
||||||
super()
|
return this.thedeskInfo.productName
|
||||||
const thedeskInfo: TheDeskInfo = ipcRenderer.sendSync('thedesk-info')
|
}
|
||||||
this.productName = thedeskInfo.productName
|
public get author(): Maintainer {
|
||||||
this.author = thedeskInfo.author
|
return this.thedeskInfo.author
|
||||||
this.contributors = thedeskInfo.contributors
|
}
|
||||||
this.homePage = thedeskInfo.homePage
|
public get contributors(): Maintainer[] {
|
||||||
this.copyrightYear = thedeskInfo.copyrightYear
|
return this.thedeskInfo.contributors
|
||||||
this.versions = {
|
}
|
||||||
"Code Name": thedeskInfo.codeName,
|
public get homePage(): string {
|
||||||
"Internal Version": thedeskInfo.versions.internal,
|
return this.thedeskInfo.homePage
|
||||||
"Chromium": thedeskInfo.versions.chrome,
|
}
|
||||||
"Electron": thedeskInfo.versions.electron,
|
public get copyrightYear(): string {
|
||||||
"Node.js": thedeskInfo.versions.node,
|
return this.thedeskInfo.copyrightYear
|
||||||
|
}
|
||||||
|
public get versions(): Versions {
|
||||||
|
return {
|
||||||
|
"Code Name": this.thedeskInfo.codeName,
|
||||||
|
"Internal Version": this.thedeskInfo.versions.internal,
|
||||||
|
"Chromium": this.thedeskInfo.versions.chrome,
|
||||||
|
"Electron": this.thedeskInfo.versions.electron,
|
||||||
|
"Node.js": this.thedeskInfo.versions.node,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user