Convert upload page to vue
This commit is contained in:
21
src/Spot.vue
21
src/Spot.vue
@@ -1,21 +1,27 @@
|
||||
<script>
|
||||
import Project from './components/project.vue';
|
||||
import Admin from './components/admin.vue';
|
||||
import Upload from './components/upload.vue';
|
||||
|
||||
const aoRoutes = {
|
||||
'project': Project,
|
||||
'admin': Admin
|
||||
'project': Project,
|
||||
'admin': Admin,
|
||||
'upload': Upload
|
||||
};
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
hash: {}
|
||||
hash: {},
|
||||
consts: this.spot.consts,
|
||||
user: this.spot.vars('user')
|
||||
};
|
||||
},
|
||||
provide() {
|
||||
return {
|
||||
projects: this.spot.vars('projects')
|
||||
projects: this.spot.vars('projects'),
|
||||
consts: this.consts,
|
||||
user: this.user
|
||||
};
|
||||
},
|
||||
inject: ['spot'],
|
||||
@@ -25,12 +31,15 @@ export default {
|
||||
return aoRoutes[this.hash.page];
|
||||
}
|
||||
},
|
||||
created() {
|
||||
//User
|
||||
this.user.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone || this.consts.default_timezone;
|
||||
},
|
||||
mounted() {
|
||||
window.addEventListener('hashchange', () => {this.onHashChange();});
|
||||
var oEvent = new Event('hashchange');
|
||||
window.dispatchEvent(oEvent);
|
||||
}
|
||||
,
|
||||
},
|
||||
methods: {
|
||||
_hash(hash, bReboot) {
|
||||
bReboot = bReboot || false;
|
||||
|
||||
Reference in New Issue
Block a user