Skip to content

Commit d2c7394

Browse files
committed
wip! [vue3] Migrate vuex to 4.x
1 parent 2df28b5 commit d2c7394

File tree

2 files changed

+67
-64
lines changed

2 files changed

+67
-64
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: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,68 @@
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-
rss_count: { },
27-
outputs: [],
28-
player: {
29-
state: 'stop',
30-
repeat: 'off',
31-
consume: false,
32-
shuffle: false,
33-
volume: 0,
34-
item_id: 0,
35-
item_length_ms: 0,
36-
item_progress_ms: 0
37-
},
38-
queue: {
39-
version: 0,
40-
count: 0,
41-
items: []
42-
},
43-
lastfm: {},
44-
spotify: {},
45-
pairing: {},
46-
47-
spotify_new_releases: [],
48-
spotify_featured_playlists: [],
49-
50-
notifications: {
51-
next_id: 1,
52-
list: []
53-
},
54-
recent_searches: [],
55-
56-
hide_singles: false,
57-
hide_spotify: false,
58-
artists_sort: 'Name',
59-
artist_albums_sort: 'Name',
60-
albums_sort: 'Name',
61-
show_only_next_items: false,
62-
show_burger_menu: false,
63-
show_player_menu: false,
64-
show_update_dialog: false,
65-
update_dialog_scan_kind: ''
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+
rss_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,
63+
show_update_dialog: false,
64+
update_dialog_scan_kind: ''
65+
}
6666
},
6767

6868
getters: {

0 commit comments

Comments
 (0)