This commit is contained in:
2018-11-16 22:36:12 +00:00
parent fbad297525
commit 0871d38c63
2 changed files with 14 additions and 26 deletions

View File

@@ -1,8 +1,10 @@
<template>
<div>
<h1>{{ lt("Log")}}</h1>
<span>{{log()}}</span>
</div>
<v-layout row>
<v-flex xs12 sm6 offset-sm3>
<h1>{{ lt("Log")}}</h1>
<v-textarea v-model="logText" full-width></v-textarea>
</v-flex>
</v-layout>
</template>
<script>
@@ -13,18 +15,17 @@ import store from "../store";
import lt from "../api/locale";
export default {
data() {
return {};
return { logText: "" };
},
beforeRouteEnter(to, from, next) {
lt.fetch(["Log"]).then(() => {
next();
});
},
mounted() {},
mounted() {
this.logText = store.state.logArray.toString();
},
methods: {
log: function() {
return store.state.logArray;
},
lt: function(key) {
return lt.get(key);
}

View File

@@ -7,25 +7,12 @@ Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOiIxNTQxNTE5NTA5IiwiZXhwIjoi
- Clean up error log view so it displays correctly with copyable text box and scrollbars of some kind
- started on it but it's narrow, this keeps happening, what to do, look into layout??
- Also make the title part of the textbox as I think it supports in v-textarea
- pre-fetch: noticed it's not pausing long enough to get teh fetched text at times (log view)
- !!This will be important to every form loading data so need to get it right here!!
- This seems to be best done in the router if I want to prefetch before the component lifecycle starts
otherwise the alternate approach is to do it in teh component but show a loading or placeholder
which is a good idea for some things like loading big lists etc but won't work with localetext
so perhaps a mix.
Here is the definitive link: https://router.vuejs.org/guide/advanced/data-fetching.html
- Need everything to stay on hold until the fetch of localized text is completed for that view somehow
- fetch in router? or how can I hold things off in vue lifecycle until it's done with the fetch of the keys?
Useful links (but see router based solution link above as that's more "canon"):
- https://vuejs.org/v2/cookbook/using-axios-to-consume-apis.html
- https://stackoverflow.com/questions/40813975/how-to-structure-api-calls-in-vue-js
- https://stackoverflow.com/questions/49577394/which-vuejs-lifecycle-hook-must-asynchronous-http-requests-be-called-in
- this might be of use, it uses async await a lot and seems to get to the heart of the issue:
https://developer.okta.com/blog/2018/02/15/build-crud-app-vuejs-node
See the created method
- Loading indicator for xhr stuff
- The thin line one I saw is pretty skookum
- Dummy form with all RAVEN required input controls on it for testing
- As if a widget but not actual widget api calls yet so can expand this form later and save time
- Dirty form check and prevent route leave: https://router.vuejs.org/guide/advanced/navigation-guards.html#in-component-guards