mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2024-12-18 20:17:50 +00:00
added vuex
This commit is contained in:
parent
08083e9ae4
commit
dc29926c91
14
web/package-lock.json
generated
14
web/package-lock.json
generated
@ -18,7 +18,8 @@
|
||||
"papaparse": "^5.4.1",
|
||||
"socket.io-client": "^4.6.1",
|
||||
"vue": "^3.2.47",
|
||||
"vue-router": "^4.1.6"
|
||||
"vue-router": "^4.1.6",
|
||||
"vuex": "^4.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rushstack/eslint-patch": "^1.2.0",
|
||||
@ -3187,6 +3188,17 @@
|
||||
"vue": "^3.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/vuex": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/vuex/-/vuex-4.0.2.tgz",
|
||||
"integrity": "sha512-M6r8uxELjZIK8kTKDGgZTYX/ahzblnzC4isU1tpmEuOIIKmV+TRdc+H4s8ds2NuZ7wpUTdGRzJRtoj+lI+pc0Q==",
|
||||
"dependencies": {
|
||||
"@vue/devtools-api": "^6.0.0-beta.11"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/which": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||
|
@ -20,7 +20,8 @@
|
||||
"papaparse": "^5.4.1",
|
||||
"socket.io-client": "^4.6.1",
|
||||
"vue": "^3.2.47",
|
||||
"vue-router": "^4.1.6"
|
||||
"vue-router": "^4.1.6",
|
||||
"vuex": "^4.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rushstack/eslint-patch": "^1.2.0",
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { createApp } from 'vue'
|
||||
import { createStore } from 'vuex'
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
|
||||
@ -6,6 +7,23 @@ import './assets/tailwind.css'
|
||||
|
||||
const app = createApp(App)
|
||||
|
||||
// Create a new store instance.
|
||||
const store = createStore({
|
||||
state () {
|
||||
return {
|
||||
count: 0,
|
||||
settingsChanged:Boolean
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
increment (state) {
|
||||
state.count++
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
app.use(router)
|
||||
app.use(store)
|
||||
|
||||
app.mount('#app')
|
@ -1150,7 +1150,8 @@ export default {
|
||||
|
||||
},
|
||||
async activated() {
|
||||
|
||||
|
||||
console.log('settings changed',this.$store.state.settingsChanged)
|
||||
// This lifecycle hook runs every time you switch from other page back to this page (vue-router)
|
||||
// To fix scrolling back to last message, this hook is needed.
|
||||
// If anyone knows hor to fix scroll issue when changing pages, please do fix it :D
|
||||
|
@ -1632,7 +1632,9 @@ export default {
|
||||
|
||||
})
|
||||
},
|
||||
settingsChanged() {
|
||||
settingsChanged(val) {
|
||||
this.$store.state.settingsChanged=val
|
||||
//this.$store.settingsChanged=val
|
||||
nextTick(() => {
|
||||
feather.replace()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user