forked from lambertkevin/webkit-issue-reproduction
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
109 lines (104 loc) · 3.56 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
var HelloWorld = Vue.component('HelloWorld', {
props: {
msg: String
},
template:
'<div class="hello">' +
'<h1>{{msg}}</h1>' +
'<p>' +
'For a guide and recipes on how to configure / customize this project,<br>' +
'check out the' +
'<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.' +
'</p>' +
'<h3>Installed CLI Plugins</h3>' +
'<ul>' +
'<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>' +
'<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a></li>' +
'</ul>' +
'<h3>Essential Links</h3>' +
'<ul>' +
'<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>' +
'<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>' +
'<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>' +
'<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>' +
'<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>' +
'</ul>' +
'<h3>Ecosystem</h3>' +
'<ul>' +
'<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>' +
'<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>' +
'<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>' +
'<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>' +
'<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>' +
'</ul>' +
'</div>',
});
var home = Vue.component('Home', {
render: function(h) {
const helloWorlds = [];
for (var i = 0; i <= 100; i++) {
helloWorlds.push(h(HelloWorld, {
props: {
msg: 'Welcome to Your Vue.js App'
}
}))
}
return h('div', {
class: 'about'
}, [
h('h1', 'This is a Home page'),
helloWorlds
])
}
})
var about = Vue.component('About', {
render: function(h) {
const helloWorlds = [];
for (var i = 0; i <= 100; i++) {
helloWorlds.push(h(HelloWorld, {
props: {
msg: 'Welcome to Your Vue.js App'
}
}))
}
return h('div', {
class: 'about'
}, [
h('h1', 'This is an about page'),
h('img', {
attrs: {
src: 'https://vuejs.org/images/logo.png'
}
}),
helloWorlds
])
}
})
var app = new Vue({
el: '#main',
data: {
comp: about
},
render: function(h) {
console.log(this.comp);
return h('div', {
attrs: {
id: 'cul',
}
}, [
h(this.comp)
])
},
mounted: function() {
// setInterval(function() {
// this.comp = this.comp === home
// ? about
// : home;
// }, 500);
setInterval(function(){
this.comp = this.comp === home
? about
: home;
}.bind(this), 500);
}
})