Skip to content

Commit cd57182

Browse files
committed
fix user/item view entering
1 parent bff04f5 commit cd57182

File tree

3 files changed

+64
-32
lines changed

3 files changed

+64
-32
lines changed

src/views/AboutView.vue

+30-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,35 @@
11
<template>
22
<div>
3-
<h2>About</h2>
4-
<p>hohoho</p>
3+
<h2>vue-hackernews-2.0</h2>
4+
<p>is a demo project built with the following technologies:</p>
5+
<ul>
6+
<li>Vue 2.0</li>
7+
<li>vue-router 2.0</li>
8+
<li>vuex 2.0</li>
9+
<li>Webpack 2.0</li>
10+
</ul>
11+
<p>Check out <a href="https://github.com/vuejs/vue/wiki/Vue-2.0-Beta---Starter-Resources" target="_blank">this guide</a> for getting started on Vue 2.0.</p>
12+
<p>This project showcases these features:</p>
13+
<ul>
14+
<li>
15+
Single file Vue components with:
16+
<ul>
17+
<li>Hot-reload during development</li>
18+
<li>Stylus for CSS pre-processing</li>
19+
<li>CSS extraction for production</li>
20+
</ul>
21+
</li>
22+
<li>
23+
Server-Side Rendering with:
24+
<ul>
25+
<li>Universal application code</li>
26+
<li>Server-side data pre-fetching</li>
27+
<li>Client-side DOM re-hydration</li>
28+
</ul>
29+
</li>
30+
<li>Powerful yet easy-to-use animation system</li>
31+
</ul>
32+
<p><a href="https://github.com/vuejs/vue-hackernews-2.0" target="_blank">Source code on GitHub.</a></p>
533
</div>
634
</template>
735

src/views/ItemView.vue

+18-16
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
<template>
2-
<div class="item-view" v-if="item">
3-
<div class="item-view-header">
4-
<a :href="item.url" target="_blank">
5-
<h2>{{ item.title }}</h2>
6-
</a>
7-
<span v-if="item.url">({{ item.url | host }})</span>
8-
<p>
9-
{{ item.score }} points
10-
| by <router-link :to="'/user/' + item.by">{{ item.by }}</router-link>
11-
{{ item.time | timeAgo }} ago
12-
| {{ item.descendants }} comments
13-
</p>
14-
</div>
15-
<ul class="item-view-comments">
16-
<comment v-for="id in item.kids" :id="id"></comment>
17-
</ul>
2+
<div class="item-view">
3+
<template v-if="item">
4+
<div class="item-view-header">
5+
<a :href="item.url" target="_blank">
6+
<h2>{{ item.title }}</h2>
7+
</a>
8+
<span v-if="item.url">({{ item.url | host }})</span>
9+
<p>
10+
{{ item.score }} points
11+
| by <router-link :to="'/user/' + item.by">{{ item.by }}</router-link>
12+
{{ item.time | timeAgo }} ago
13+
| {{ item.descendants }} comments
14+
</p>
15+
</div>
16+
<ul class="item-view-comments">
17+
<comment v-for="id in item.kids" :id="id"></comment>
18+
</ul>
19+
</template>
1820
</div>
1921
</template>
2022

src/views/UserView.vue

+16-14
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
<template>
2-
<div class="user-view" v-if="user">
3-
<ul>
4-
<li><span class="label">user:</span> {{ user.id }}</li>
5-
<li><span class="label">created:</span> {{ user.created | timeAgo }} ago</li>
6-
<li><span class="label">karma:</span> {{user.karma}}</li>
7-
<li>
8-
<span class="label">about:</span>
9-
<div class="about" v-html="user.about"></div>
10-
</li>
11-
</ul>
12-
<p class="links">
13-
<a :href="'https://news.ycombinator.com/submitted?id=' + user.id">submissions</a><br>
14-
<a :href="'https://news.ycombinator.com/threads?id=' + user.id">comments</a>
15-
</p>
2+
<div class="user-view">
3+
<template v-if="user">
4+
<ul>
5+
<li><span class="label">user:</span> {{ user.id }}</li>
6+
<li><span class="label">created:</span> {{ user.created | timeAgo }} ago</li>
7+
<li><span class="label">karma:</span> {{user.karma}}</li>
8+
<li>
9+
<span class="label">about:</span>
10+
<div class="about" v-html="user.about"></div>
11+
</li>
12+
</ul>
13+
<p class="links">
14+
<a :href="'https://news.ycombinator.com/submitted?id=' + user.id">submissions</a><br>
15+
<a :href="'https://news.ycombinator.com/threads?id=' + user.id">comments</a>
16+
</p>
17+
</template>
1618
</div>
1719
</template>
1820

0 commit comments

Comments
 (0)