release v2.0.0 #4

Merged
crimsen merged 481 commits from develop into master 2024-01-18 15:15:08 +00:00
2 changed files with 23 additions and 23 deletions
Showing only changes of commit 3f756437ee - Show all commits

View File

@ -41,20 +41,19 @@ export default defineComponent({
}, },
setup(props, { root }) { setup(props, { root }) {
let title = props.title; let title = computed<string>(() => {
if (props.title.includes('loadFromStore')) { if (props.title.includes('loadFromStore')) {
const startIndex = props.title.indexOf('(') + 1; const startIndex = props.title.indexOf('(') + 1;
const endIndex = props.title.indexOf(')'); const endIndex = props.title.indexOf(')');
const substring = props.title const substring = props.title
.substring(startIndex, endIndex) .substring(startIndex, endIndex)
.replace(/"/g, ''); .replace(/"/g, '');
console.log(substring); console.log(substring);
console.log(root.$store.getters[substring]); console.log('loadFromStore');
console.log('loadFromStore'); return <string>root.$store.getters[substring];
title = computed(() => { }
return root.$store.getters[substring]; return props.title;
}); });
}
return { realTitle: title }; return { realTitle: title };
} }
}); });

View File

@ -22,10 +22,7 @@
/> />
</div> </div>
<div class="row"> <div class="row">
<q-btn <q-btn label="show sessions" @click="showRootGetters" />
label="show sessions"
@click="showRootGetters"
/>
</div> </div>
</q-page> </q-page>
</div> </div>
@ -41,18 +38,22 @@ export default defineComponent({
components: { CircularProgress, Sessions, Main }, components: { CircularProgress, Sessions, Main },
setup(_, { root }) { setup(_, { root }) {
onBeforeMount(() => { onBeforeMount(() => {
root.$store.dispatch('sessions/getSessions'); root.$store.dispatch('sessions/getSessions').catch(error => {
console.warn(error);
});
}); });
const sessions = computed(() => root.$store.getters['sessions/sessions']); const sessions = computed(
() => <FG.Session[]>root.$store.getters['sessions/sessions']
);
function showRootGetters() { function showRootGetters() {
//ctx.root.$store.dispatch('sessions/getSessions'); //ctx.root.$store.dispatch('sessions/getSessions');
console.log(sessions.value); console.log(sessions.value);
} }
const sessionsLoading = computed(() => { const sessionsLoading = computed(
return root.$store.getters['sessions/loading']; () => <boolean>root.$store.getters['sessions/loading']
}); );
return { return {
showRootGetters, showRootGetters,