Skip to content

Commit b2c2efd

Browse files
committed
wip! [vue3] Migrate vuex to 4.x
1 parent 91c170e commit b2c2efd

File tree

2 files changed

+64
-61
lines changed

2 files changed

+64
-61
lines changed

web-src/src/main.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import { createApp } from 'vue'
2+
import store from './store'
23
import App from './App.vue'
34

4-
createApp(App).mount('#app')
5+
createApp(App)
6+
.use(store)
7+
.mount('#app')

web-src/src/store/index.js

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,65 @@
1-
import Vue from 'vue'
2-
import Vuex from 'vuex'
1+
import { createStore } from 'vuex'
32
import * as types from './mutation_types'
43

5-
Vue.use(Vuex)
6-
7-
export default new Vuex.Store({
8-
state: {
9-
config: {
10-
websocket_port: 0,
11-
version: '',
12-
buildoptions: []
13-
},
14-
settings: {
15-
categories: []
16-
},
17-
library: {
18-
artists: 0,
19-
albums: 0,
20-
songs: 0,
21-
db_playtime: 0,
22-
updating: false
23-
},
24-
audiobooks_count: { },
25-
podcasts_count: { },
26-
outputs: [],
27-
player: {
28-
state: 'stop',
29-
repeat: 'off',
30-
consume: false,
31-
shuffle: false,
32-
volume: 0,
33-
item_id: 0,
34-
item_length_ms: 0,
35-
item_progress_ms: 0
36-
},
37-
queue: {
38-
version: 0,
39-
count: 0,
40-
items: []
41-
},
42-
lastfm: {},
43-
spotify: {},
44-
pairing: {},
45-
46-
spotify_new_releases: [],
47-
spotify_featured_playlists: [],
48-
49-
notifications: {
50-
next_id: 1,
51-
list: []
52-
},
53-
recent_searches: [],
54-
55-
hide_singles: false,
56-
hide_spotify: false,
57-
artists_sort: 'Name',
58-
artist_albums_sort: 'Name',
59-
albums_sort: 'Name',
60-
show_only_next_items: false,
61-
show_burger_menu: false,
62-
show_player_menu: false
4+
5+
export default createStore({
6+
state () {
7+
return {
8+
config: {
9+
websocket_port: 0,
10+
version: '',
11+
buildoptions: []
12+
},
13+
settings: {
14+
categories: []
15+
},
16+
library: {
17+
artists: 0,
18+
albums: 0,
19+
songs: 0,
20+
db_playtime: 0,
21+
updating: false
22+
},
23+
audiobooks_count: { },
24+
podcasts_count: { },
25+
outputs: [],
26+
player: {
27+
state: 'stop',
28+
repeat: 'off',
29+
consume: false,
30+
shuffle: false,
31+
volume: 0,
32+
item_id: 0,
33+
item_length_ms: 0,
34+
item_progress_ms: 0
35+
},
36+
queue: {
37+
version: 0,
38+
count: 0,
39+
items: []
40+
},
41+
lastfm: {},
42+
spotify: {},
43+
pairing: {},
44+
45+
spotify_new_releases: [],
46+
spotify_featured_playlists: [],
47+
48+
notifications: {
49+
next_id: 1,
50+
list: []
51+
},
52+
recent_searches: [],
53+
54+
hide_singles: false,
55+
hide_spotify: false,
56+
artists_sort: 'Name',
57+
artist_albums_sort: 'Name',
58+
albums_sort: 'Name',
59+
show_only_next_items: false,
60+
show_burger_menu: false,
61+
show_player_menu: false
62+
}
6363
},
6464

6565
getters: {

0 commit comments

Comments
 (0)