Skip to content

Commit 2588bde

Browse files
committed
upgrade to 0.11.3
1 parent 933c5b1 commit 2588bde

File tree

7 files changed

+9225
-37
lines changed

7 files changed

+9225
-37
lines changed

build/build.js

Lines changed: 9179 additions & 6 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
"insert-css": "^0.2.0",
2222
"stylus": "^0.49.1",
2323
"uglify-js": "^2.4.15",
24-
"vueify": "^0.1.0",
25-
"watchify": "^2.0.0"
24+
"vueify": "^1.1.0",
25+
"watchify": "^2.1.1"
2626
},
2727
"dependencies": {
2828
"director": "^1.2.3",
2929
"firebase": "^1.1.1",
30-
"vue": "git://github.com/yyx990803/vue#next"
30+
"vue": "0.11.3"
3131
}
3232
}

src/app.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ a
6969
</span>
7070
</div>
7171
<!-- main view -->
72-
<div v-component="{{view}}" v-transition></div>
72+
<div v-component="{{view}}" v-with="params:params" v-transition></div>
7373
</template>
7474

7575
<script>

src/components/comment.vue

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,24 @@
2020
</style>
2121

2222
<template>
23-
<div class="comhead">
24-
<a class="toggle" v-on="click:open = !open">{{open ? '[-]' : '[+]'}}</a>
25-
<a href="#/user/{{by}}">{{by}}</a>
26-
{{time | fromNow}} ago
27-
</div>
28-
<div class="comment-content" v-html="text" v-show="open"></div>
29-
<ul class="child-comments" v-if="kids" v-show="open">
30-
<li v-repeat="comments" v-component="comment"></li>
31-
</ul>
23+
<li v-show="text">
24+
<div class="comhead">
25+
<a class="toggle" v-on="click:open = !open">{{open ? '[-]' : '[+]'}}</a>
26+
<a href="#/user/{{by}}">{{by}}</a>
27+
{{time | fromNow}} ago
28+
</div>
29+
<div class="comment-content" v-html="text" v-show="open"></div>
30+
<ul class="child-comments" v-if="kids" v-show="open">
31+
<li v-repeat="comments" v-component="comment"></li>
32+
</ul>
33+
</li>
3234
</template>
3335

3436
<script>
3537
var store = require('../store')
3638
3739
module.exports = {
40+
replace: true,
3841
data: function () {
3942
return {
4043
open: true,

src/views/item-view.vue

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</style>
2020

2121
<template>
22-
<div class="view item-view" v-with="id:params.itemId" v-show="item">
22+
<div class="view item-view" v-show="item">
2323
<div class="item" v-component="item" v-with="item"></div>
2424
<ul class="poll-options" v-if="pollOptions">
2525
<li v-repeat="pollOptions">
@@ -28,7 +28,7 @@
2828
</li>
2929
</ul>
3030
<ul class="comments" v-if="comments">
31-
<li v-repeat="comments" v-component="comment" v-show="text"></li>
31+
<li v-repeat="comments" v-component="comment"></li>
3232
</ul>
3333
<p v-show="!comments.length">No comments yet.</p>
3434
</div>
@@ -41,19 +41,23 @@ module.exports = {
4141
replace: true,
4242
data: function () {
4343
return {
44-
id: null,
44+
params: {
45+
itemId: null
46+
},
4547
item: null,
4648
pollOptions: null,
47-
comments: null
49+
comments: []
4850
}
4951
},
52+
watch: {
53+
'params.itemId': 'update'
54+
},
5055
compiled: function () {
5156
this.update()
52-
this.$watch('id', this.update)
5357
},
5458
methods: {
5559
update: function () {
56-
store.fetchItem(this.id, function (item) {
60+
store.fetchItem(this.params.itemId, function (item) {
5761
this.item = item
5862
this.fetchComments()
5963
if (item.type === 'poll') {

src/views/news-view.vue

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
</style>
1919

2020
<template>
21-
<div class="view news-view" v-with="page:params.page" v-class="loading:!items.length">
21+
<div class="view news-view" v-class="loading:!items.length">
2222
<!-- item list -->
2323
<ul>
24-
<li class="item" v-repeat="items" v-component="item" trackby="id"></li>
24+
<li class="item" v-repeat="items" v-component="item" track-by="id"></li>
2525
</ul>
2626
<!-- navigation -->
2727
<div class="nav" v-show="items.length > 0">
28-
<a v-if="page > 1" href="#/news/{{page - 1}}">&lt; prev</a>
29-
<a v-if="page < 4" href="#/news/{{page + 1}}">more...</a>
28+
<a v-if="params.page > 1" href="#/news/{{params.page - 1}}">&lt; prev</a>
29+
<a v-if="params.page < 4" href="#/news/{{params.page + 1}}">more...</a>
3030
</div>
3131
</div>
3232
</template>
@@ -38,15 +38,19 @@ module.exports = {
3838
replace: true,
3939
data: function () {
4040
return {
41-
page: 1,
41+
params: {
42+
page: 1
43+
},
4244
displayPage: 1,
4345
items: []
4446
}
4547
},
48+
watch: {
49+
'params.page': 'update'
50+
},
4651
compiled: function () {
4752
this.update()
4853
store.on('update', this.update)
49-
this.$watch('page', this.update)
5054
},
5155
destroyed: function () {
5256
store.removeListener('update', this.update)
@@ -56,9 +60,9 @@ module.exports = {
5660
},
5761
methods: {
5862
update: function () {
59-
store.fetchItemsByPage(this.page, function (items) {
63+
store.fetchItemsByPage(this.params.page, function (items) {
6064
this.items = items
61-
this.displayPage = this.page
65+
this.displayPage = this.params.page
6266
}.bind(this))
6367
}
6468
}

src/views/user-view.vue

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</style>
1414

1515
<template>
16-
<div class="view user-view" v-with="id:params.userId" v-show="user">
16+
<div class="view user-view" v-show="user">
1717
<ul>
1818
<li><span class="label">user:</span> {{user.id}}</li>
1919
<li><span class="label">created:</span> {{user.created | fromNow}} ago</li>
@@ -37,13 +37,17 @@ module.exports = {
3737
replace: true,
3838
data: function () {
3939
return {
40-
id: null,
41-
user: null
40+
params: {
41+
userId: null
42+
},
43+
user: {}
4244
}
4345
},
46+
watch: {
47+
'params.userId': 'update'
48+
},
4449
compiled: function () {
4550
this.update()
46-
this.$watch('id', this.update)
4751
},
4852
methods: {
4953
update: function () {

0 commit comments

Comments
 (0)