File tree Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change 23
23
tr( v-for ="post in computedList" key ="tr" class ="table-row-item" : to= "'/post/' + post.topicId" v-on:click ="goToPost(post.topicId, post.announce)" )
24
24
td( key ="announce" ) {{ post.announce }}
25
25
td( key ="replies" ) {{ post.NumReplies }}
26
- td( key ="views " ) {{ post.DateTimeLastPost }}
26
+ td( key ="lastComment " ) {{ post.DateTimeLastPost }}
27
27
td( key ="rank" ) {{ post.rank }}
28
28
td.links ( key ="links" )
29
29
a( v-on:click ="dataHref(post.topicStarterUrl, $event)" )
Original file line number Diff line number Diff line change
1
+ import Vue from 'vue'
2
+ import Vuex from 'vuex'
3
+ import axios from 'axios'
4
+ Vue . use ( Vuex )
5
+
6
+ const store = new Vuex . Store ( {
7
+ state : {
8
+ assets : [ ]
9
+ } ,
10
+ actions : {
11
+ LOAD_ASSETS_LIST : function ( { commit } ) {
12
+ axios . get ( '/static/data/announceList.json' , {
13
+ headers : { 'Cache-Control' : 'private, max-age=0, no-cache' }
14
+ } ) . then ( ( response ) => {
15
+ commit ( 'SET_ASSETS_LIST' , { list : response . data } )
16
+ } , ( err ) => {
17
+ console . log ( err )
18
+ } )
19
+ } ,
20
+ } ,
21
+ mutations : {
22
+ SET_ASSETS_LIST : ( state , { list } ) => {
23
+ state . assets = list
24
+ } ,
25
+ } ,
26
+ getters : {
27
+ fullAssetsList : ( state , getters ) => ( id ) => {
28
+ if ( state . assets . length !== 0 ) {
29
+ return state . assets . filter ( ( item ) => {
30
+ return item . announce . toLowerCase ( ) . indexOf ( id . toLowerCase ( ) ) !== - 1
31
+ } )
32
+ }
33
+ }
34
+ }
35
+ } )
36
+
37
+ export default store
You can’t perform that action at this time.
0 commit comments