use loadash

This commit is contained in:
jb-alvarado 2021-03-23 10:40:57 +01:00
parent 3420ec06b3
commit a56d9c74bc
5 changed files with 22 additions and 2 deletions

View File

@ -50,7 +50,8 @@ export default {
{ src: '~plugins/scrollbar.js', ssr: false },
{ src: '~plugins/splitpanes.js', ssr: false },
{ src: '~plugins/loading.js', ssr: false },
{ src: '~plugins/draggable.js', ssr: false }
{ src: '~plugins/draggable.js', ssr: false },
{ src: '~plugins/loadash.js', ssr: false }
],
/*
** Nuxt.js dev-modules

12
package-lock.json generated
View File

@ -15,6 +15,7 @@
"bootstrap-vue": "^2.21.2",
"cookie-universal-nuxt": "^2.1.4",
"jwt-decode": "^3.1.2",
"loadash": "^1.0.0",
"nuxt": "^2.15.3",
"splitpanes": "^2.3.6",
"video.js": "^7.11.4",
@ -9681,6 +9682,12 @@
"node": ">=0.10.0"
}
},
"node_modules/loadash": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/loadash/-/loadash-1.0.0.tgz",
"integrity": "sha512-xlX5HBsXB3KG0FJbJJG/3kYWCfsCyCSus3T+uHVu6QL6YxAdggmm3QeyLgn54N2yi5/UE6xxL5ZWJAAiHzHYEg==",
"deprecated": "Package is unsupport. Please use the lodash package instead."
},
"node_modules/loader-runner": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz",
@ -24832,6 +24839,11 @@
}
}
},
"loadash": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/loadash/-/loadash-1.0.0.tgz",
"integrity": "sha512-xlX5HBsXB3KG0FJbJJG/3kYWCfsCyCSus3T+uHVu6QL6YxAdggmm3QeyLgn54N2yi5/UE6xxL5ZWJAAiHzHYEg=="
},
"loader-runner": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz",

View File

@ -19,6 +19,7 @@
"bootstrap-vue": "^2.21.2",
"cookie-universal-nuxt": "^2.1.4",
"jwt-decode": "^3.1.2",
"loadash": "^1.0.0",
"nuxt": "^2.15.3",
"splitpanes": "^2.3.6",
"video.js": "^7.11.4",

4
plugins/loadash.js Normal file
View File

@ -0,0 +1,4 @@
import Vue from 'vue'
import _ from 'lodash'
Object.defineProperty(Vue.prototype, '$_', { value: _ })

View File

@ -1,3 +1,5 @@
import _ from 'lodash'
export const state = () => ({
playlist: null,
playlistToday: [],
@ -63,7 +65,7 @@ export const actions = {
commit('UPDATE_PLAYLIST', this.$processPlaylist(dayStart, response.data.program))
if (date === dateToday) {
commit('UPDATE_TODAYS_PLAYLIST', JSON.parse(JSON.stringify(response.data.program)))
commit('UPDATE_TODAYS_PLAYLIST', _.cloneDeep(response.data.program))
dispatch('setCurrentClip')
} else {
commit('SET_CURRENT_CLIP_INDEX', null)