Skip to content

Commit 7822321

Browse files
author
Online Web Tutor
committed
reference type and primitive type
1 parent ba4b265 commit 7822321

File tree

7 files changed

+152
-33
lines changed

7 files changed

+152
-33
lines changed

.babelrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"presets": [
3+
["env", { "modules": false }],
4+
"stage-3"
5+
]
6+
}

.editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

.gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.DS_Store
2+
node_modules/
3+
dist/
4+
npm-debug.log
5+
yarn-error.log
6+
7+
# Editor directories and files
8+
.idea
9+
*.suo
10+
*.ntvs*
11+
*.njsproj
12+
*.sln

simple.html

-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,5 @@ <h3>Playlists</h3>
5454
<footer>
5555
Copyright @Online Web Tutor Developers 2018
5656
</footer>
57-
5857
</body>
5958
</html>

src/App.vue

+41-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
<div>
33
<owt-header></owt-header>
44

5-
<owt-content></owt-content>
5+
<owt-content v-bind:simple-message="someMessage" v-bind:students="students" channel-name="Online Web Tutor" name="Sanjay Kumar" v-bind:is-learning="false" v-bind:author="{name:'Sanjay',email:'[email protected]'}" v-bind:myplaylist="playlists"></owt-content>
6+
7+
<owt-student v-bind:simple-message="someMessage" v-bind:students="students"></owt-student>
68

79
<owt-footer></owt-footer>
810
</div>
@@ -13,16 +15,52 @@
1315
import Header from './components/Header.vue'
1416
import Footer from './components/Footer.vue'
1517
import Content from './components/Content.vue'
18+
import Student from './components/Student.vue'
1619
1720
export default {
1821
components:{
1922
"owt-header": Header,
2023
"owt-footer": Footer,
21-
"owt-content": Content
24+
"owt-content": Content,
25+
"owt-student":Student
2226
},
2327
data () {
2428
return {
25-
29+
playlists:[
30+
{
31+
name:"Wordpress Plugin Development",
32+
githublink:"https://github.com/owthub/wordpress-plugin",
33+
title:"Wordpress Plugin Development"
34+
},
35+
{
36+
name:"Wordpress Theme Development",
37+
githublink:"https://github.com/owthub/wordpress-theme",
38+
title:"Wordpress Theme Development"
39+
},
40+
{
41+
name:"Vue Js2 Development",
42+
githublink:"https://github.com/owthub/vuejs2",
43+
title:"Vue Js2 Development"
44+
},
45+
{
46+
name:"WP JSON Rest API Development",
47+
githublink:"https://github.com/owthub/wordpress-json-rest-api",
48+
title:"WP JSON Rest API Development"
49+
},
50+
{
51+
name:"WP JSON Rest API Development",
52+
githublink:"https://github.com/owthub/wordpress-json-rest-api",
53+
title:"WP JSON Rest API Development"
54+
}
55+
],
56+
students:[
57+
"Sanjay",
58+
"Rahul",
59+
"Rakesh",
60+
"Aman",
61+
"Vijay"
62+
],
63+
someMessage:"Simple message defined here"
2664
}
2765
}
2866
}

src/components/Content.vue

+46-29
Original file line numberDiff line numberDiff line change
@@ -2,49 +2,66 @@
22
<div>
33
<div id="content">
44
<h3>Playlists</h3>
5+
{{ channelName }} AND {{ name }}
56
<ul>
6-
<li v-for="playlist in playlists">
7+
<li v-for="playlist in myplaylist">
78
<a v-bind:href="playlist.githublink" v-bind:title="playlist.title" target="_blank">
89
{{ playlist.name }}
910
</a>
1011
</li>
1112
</ul>
13+
14+
<h2>Student List</h2>
15+
<ul>
16+
<li v-for="student in students">{{ student }}</li>
17+
</ul>
18+
<button v-on:click="deleteStudent">Delete Student</button>
19+
20+
<h3>Simple message: {{ simpleMessage }}</h3>
21+
22+
{{ call1() }}
1223
</div>
1324
</div>
1425
</template>
1526

1627
<script>
1728
export default {
18-
29+
/*props:["name","myplaylist","channelName"],*/
30+
props:{
31+
simpleMessage:{
32+
type: String
33+
},
34+
students:{
35+
type: Array
36+
},
37+
name:{
38+
type: String,
39+
default: "Default name"
40+
},
41+
myplaylist:{
42+
type: Array
43+
},
44+
channelName:{
45+
type: String
46+
},
47+
author:{
48+
type:Object
49+
},
50+
isLearning:{
51+
type: Boolean
52+
}
53+
},
1954
data () {
2055
return {
21-
playlists:[
22-
{
23-
name:"Wordpress Plugin Development",
24-
githublink:"https://github.com/owthub/wordpress-plugin",
25-
title:"Wordpress Plugin Development"
26-
},
27-
{
28-
name:"Wordpress Theme Development",
29-
githublink:"https://github.com/owthub/wordpress-theme",
30-
title:"Wordpress Theme Development"
31-
},
32-
{
33-
name:"Vue Js2 Development",
34-
githublink:"https://github.com/owthub/vuejs2",
35-
title:"Vue Js2 Development"
36-
},
37-
{
38-
name:"WP JSON Rest API Development",
39-
githublink:"https://github.com/owthub/wordpress-json-rest-api",
40-
title:"WP JSON Rest API Development"
41-
},
42-
{
43-
name:"WP JSON Rest API Development",
44-
githublink:"https://github.com/owthub/wordpress-json-rest-api",
45-
title:"WP JSON Rest API Development"
46-
}
47-
]
56+
message:"This is simple message"
57+
}
58+
},
59+
methods:{
60+
call1: function(){
61+
console.log(this.channelName);
62+
},
63+
deleteStudent:function(){
64+
this.students.pop();
4865
}
4966
}
5067
}

src/components/Student.vue

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<template>
2+
<div>
3+
4+
<div id="content">
5+
<h2>Students List</h2>
6+
<ul>
7+
<li v-for="student in students">{{ student }}</li>
8+
</ul>
9+
10+
<h3>Simple message: {{ simpleMessage }}</h3>
11+
<button v-on:click="UpdateMessage">Update message</button>
12+
13+
</div>
14+
</div>
15+
</template>
16+
17+
<script>
18+
export default {
19+
props:{
20+
simpleMessage:{
21+
type: String
22+
},
23+
students:{
24+
type: Array
25+
}
26+
},
27+
data () {
28+
return {
29+
message:"This is simple message"
30+
}
31+
},
32+
methods:{
33+
UpdateMessage: function(){
34+
this.simpleMessage = "Simple message has been updated";
35+
}
36+
}
37+
}
38+
</script>

0 commit comments

Comments
 (0)