Add get timeline to Column component
Change to uncomment import Column of Main component
This commit is contained in:
parent
e8f73dbaa8
commit
a931e82f41
|
@ -8,7 +8,7 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Component, Prop, Vue } from 'vue-property-decorator'
|
import { Component, Prop, Vue } from 'vue-property-decorator'
|
||||||
|
|
||||||
// import Column from '@/components/Timeline/Column.vue'
|
import Column from '@/components/Timeline/Column.vue'
|
||||||
|
|
||||||
interface TimelineDoc {
|
interface TimelineDoc {
|
||||||
_id: string
|
_id: string
|
||||||
|
@ -18,7 +18,7 @@ interface TimelineDoc {
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
components: {
|
components: {
|
||||||
//Column,
|
Column,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
export default class Main extends Vue {
|
export default class Main extends Vue {
|
||||||
|
|
|
@ -14,6 +14,11 @@ import Toot from '@/components/Timeline/Toot.vue'
|
||||||
|
|
||||||
import "@/extensions/map-sortbyvalue" // Add sortByValue function to Map prototype
|
import "@/extensions/map-sortbyvalue" // Add sortByValue function to Map prototype
|
||||||
|
|
||||||
|
interface TimelineDoc {
|
||||||
|
name: string
|
||||||
|
type: string
|
||||||
|
}
|
||||||
|
|
||||||
type Statuses = Map<number, Status>
|
type Statuses = Map<number, Status>
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -22,7 +27,9 @@ type Statuses = Map<number, Status>
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
export default class Column extends Vue {
|
export default class Column extends Vue {
|
||||||
@Prop() public id?: string
|
@Prop({
|
||||||
|
required: true
|
||||||
|
}) public id!: string
|
||||||
|
|
||||||
//test
|
//test
|
||||||
public pref = {
|
public pref = {
|
||||||
|
@ -49,8 +56,9 @@ export default class Column extends Vue {
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
// timelineのnameとtypeをthis.idから取得する
|
// timelineのnameとtypeをthis.idから取得する
|
||||||
this.name = ''
|
let doc: TimelineDoc = ipcRenderer.sendSync('get-timeline', this.id)
|
||||||
this.type = ''
|
this.name = doc.name
|
||||||
|
this.type = doc.type
|
||||||
// TODO: このイベントのchannel名、timelineのidがいいか?
|
// TODO: このイベントのchannel名、timelineのidがいいか?
|
||||||
ipcRenderer.once(`timeline-${this.name}-${this.type}`, (e: Event, statuses: Status[], error?: Error) => {
|
ipcRenderer.once(`timeline-${this.name}-${this.type}`, (e: Event, statuses: Status[], error?: Error) => {
|
||||||
if (error === undefined) {
|
if (error === undefined) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user