Guest User

Untitled

a guest
Aug 17th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. <script lang="ts">
  2.  
  3. import Vue from "vue"
  4. import {TimeLine, TimelineState} from '../../timeline/timeline';
  5. // import Pointer from './Pointer.vue';
  6.  
  7. export default Vue.extend({
  8. name: "timeline",
  9. // components: {
  10. // 'pointer' : Pointer
  11. // },
  12. data() {
  13. const initialState: TimelineState = {
  14. name: "timeline component.",
  15. cheffeTimeline: new TimeLine('lane-container', 'lane', 25) as TimeLine
  16. };
  17. return initialState;
  18. },
  19. methods: {
  20. instantiate () {
  21. console.log('instantiate this', this);
  22. console.log('timeline', this.cheffeTimeline);
  23. console.log('test', this.cheffeTimeline.test);
  24. this.cheffeTimeline.addRandomBlocks(10);
  25. }
  26. }
  27. })
  28.  
  29. export interface TimelineState {
  30. name: string;
  31. cheffeTimeline: TimeLine;
  32. }
  33.  
  34. export class TimeLine {
  35.  
  36. private containerName: string;
  37. private itemName: string;
  38.  
  39. public test: number = 2;
  40.  
  41. public constructor (containerName: string, itemName: string, gutter: number) {
  42.  
  43. this.containerName = containerName;
  44. this.itemName = itemName;
  45. }
  46.  
  47. public addRandomBlocks (number: number) {
  48. // whatever
  49. }
  50. }
Add Comment
Please, Sign In to add comment