🔥 Use VueX store instead of props for router
This commit is contained in:
@@ -7,18 +7,13 @@ import JsonToYaml from '@/utils/JsonToYaml';
|
||||
|
||||
export default {
|
||||
name: 'DownloadConfig',
|
||||
props: {
|
||||
sections: Array,
|
||||
appConfig: Object,
|
||||
pageInfo: Object,
|
||||
computed: {
|
||||
config() {
|
||||
return this.$store.state.config;
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
config: {
|
||||
appConfig: this.appConfig,
|
||||
pageInfo: this.pageInfo,
|
||||
sections: this.sections,
|
||||
},
|
||||
jsonParser: JsonToYaml,
|
||||
};
|
||||
},
|
||||
|
||||
@@ -55,11 +55,6 @@ import Defaults, { localStorageKeys, iconCdns } from '@/utils/defaults';
|
||||
|
||||
export default {
|
||||
name: 'home',
|
||||
props: {
|
||||
sections: Array, // Main site content
|
||||
appConfig: Object, // Main site configuation (optional)
|
||||
pageInfo: Object, // Page metadata (optional)
|
||||
},
|
||||
components: {
|
||||
SettingsContainer,
|
||||
Section,
|
||||
@@ -71,6 +66,15 @@ export default {
|
||||
modalOpen: false, // When true, keybindings are disabled
|
||||
}),
|
||||
computed: {
|
||||
sections() {
|
||||
return this.$store.getters.sections;
|
||||
},
|
||||
appConfig() {
|
||||
return this.$store.getters.appConfig;
|
||||
},
|
||||
pageInfo() {
|
||||
return this.$store.getters.pageInfo;
|
||||
},
|
||||
/* Get class for num columns, if specified by user */
|
||||
colCount() {
|
||||
let { colCount } = this.appConfig;
|
||||
|
||||
@@ -91,9 +91,6 @@ export default {
|
||||
Button,
|
||||
Input,
|
||||
},
|
||||
props: {
|
||||
appConfig: Object,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
username: '',
|
||||
@@ -104,6 +101,9 @@ export default {
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
appConfig() {
|
||||
return this.$store.getters.appConfig;
|
||||
},
|
||||
/* Data for timeout dropdown menu, translated label + value in ms */
|
||||
dropDownMenu() {
|
||||
return [
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
<div class="minimal-home" :style="getBackgroundImage() + setColumnCount()">
|
||||
<!-- Buttons for config and home page -->
|
||||
<div class="minimal-buttons">
|
||||
<ConfigLauncher :sections="sections" :pageInfo="pageInfo" :appConfig="appConfig"
|
||||
@modalChanged="modalChanged" class="config-launcher" />
|
||||
<ConfigLauncher @modalChanged="modalChanged" class="config-launcher" />
|
||||
</div>
|
||||
<!-- Page title and search bar -->
|
||||
<div class="title-and-search">
|
||||
@@ -60,11 +59,6 @@ import ConfigLauncher from '@/components/Settings/ConfigLauncher';
|
||||
|
||||
export default {
|
||||
name: 'home',
|
||||
props: {
|
||||
sections: Array, // Main site content
|
||||
appConfig: Object, // Main site configuation (optional)
|
||||
pageInfo: Object,
|
||||
},
|
||||
components: {
|
||||
MinimalSection,
|
||||
MinimalHeading,
|
||||
@@ -79,6 +73,17 @@ export default {
|
||||
tabbedView: true, // By default use tabs, when searching then show all instead
|
||||
theme: GetTheme(),
|
||||
}),
|
||||
computed: {
|
||||
sections() {
|
||||
return this.$store.getters.sections;
|
||||
},
|
||||
appConfig() {
|
||||
return this.$store.getters.appConfig;
|
||||
},
|
||||
pageInfo() {
|
||||
return this.$store.getters.pageInfo;
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
/* When the theme changes, then call the update method */
|
||||
searchValue() {
|
||||
|
||||
@@ -16,10 +16,6 @@ import { GetTheme, ApplyLocalTheme, ApplyCustomVariables } from '@/utils/ThemeHe
|
||||
|
||||
export default {
|
||||
name: 'Workspace',
|
||||
props: {
|
||||
sections: Array,
|
||||
appConfig: Object,
|
||||
},
|
||||
data: () => ({
|
||||
url: '',
|
||||
GetTheme,
|
||||
@@ -27,6 +23,12 @@ export default {
|
||||
ApplyCustomVariables,
|
||||
}),
|
||||
computed: {
|
||||
sections() {
|
||||
return this.$store.getters.sections;
|
||||
},
|
||||
appConfig() {
|
||||
return this.$store.getters.appConfig;
|
||||
},
|
||||
isMultiTaskingEnabled() {
|
||||
return this.appConfig.enableMultiTasking || false;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user