08.02.2017 Views

vuejs

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Components 73<br />

1 <br />

2 <br />

3 <br />

5 Hello Vue<br />

6 <br />

7 <br />

8 <br />

9 <br />

10 Let's hear some stories!<br />

11 <br />

12 <br />

13 <br />

14 {{ $data | json }}<br />

15 <br />

16 <br />

17 <br />

18 <br />

19 {{ story.writer }} said "{{ story.plot }}"<br />

20 <br />

21 <br />

22 <br />

23 <br />

24 <br />

25 Vue.component('story', {<br />

26 template: "#story-template",<br />

27 props: ['story'],<br />

28 });<br />

29<br />

30 new Vue({<br />

31 el: '#app',<br />

32 data: {<br />

33 stories: [<br />

34 {<br />

35 plot: 'My horse is amazing.',<br />

36 writer: 'Mr. Weebl',<br />

37 },<br />

38 {<br />

39 plot: 'Narwhals invented Shish Kebab.',<br />

40 writer: 'Mr. Weebl',<br />

41 },<br />

42 {

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!