-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentry_server.js
22 lines (22 loc) · 1.26 KB
/
entry_server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
export function render() {
return `
<div id='home' data-server-rendered="true" style="padding: 0 20px">
<h3 class="blue">Home Page: I am global class.</h3>
<span>我是home组件,尝试了服务器渲染和浏览器渲染, 是同步加载的。可以通过浏览器dev tools查看。</span>
<h4>History Router: <a href="/list">list link</a> <a href="/detail">detail link</a></h4>
<h4>V-model, input something.</h4>
<input type="text" v-model="someStr" defaultValue="Hello">
<p v-text="someStr" v-class="className">Hello</p>
<textarea v-model="child.someStr" cols="20">World !</textarea>
<p v-text="child.someStr" v-class="className">World !</p>
<h4>Computed attribute</h4>
<p v-class="className" v-text="getHelloWord">Hello World !</p>
<h4>V-on:click <button v-on:click="clickBtn">Change data</button></h4>
<h4>V-html</h4>
<div v-html="child.htmlStr"><p>I am generated by<strong style="color: red"> v-html</strong></p></div>
<h4>V-for <button v-on:click="changePeople">Change data</button></h4>
<ul v-for="item in items" style="padding:15px">
<li>{{ item.name }} {{ item.message }}</li>
</ul>
</div>`;
}