Skip to content

Commit

Permalink
Fix vue component missing code - dynamic url, base styles
Browse files Browse the repository at this point in the history
  • Loading branch information
Martins Fridenbergs committed Sep 27, 2019
1 parent d5d4f85 commit 62285cf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ Recommended contributions:
* UI customisation options

##Authors

Martins Fridenbergs
23 changes: 18 additions & 5 deletions resources/js/currently_viewing.vue
Original file line number Diff line number Diff line change
@@ -1,23 +1,33 @@
<template>
<div class="currentlyViewingPageWrapper">
<ul class="users list-group">
<li v-for="user in users">
<li class="list-group-item" v-for="user in users">
<span>
{{ user.name }}
</span>
</li>>
</li>
</ul>
</div>
</template>
<script>
import axios from 'axios'
export default {
props: {
url: {
type: String,
required: false,
}
},
data() {
return {
watcher: {},
users: {},
view_url: '',
}
},
mounted() {
this.view_url = this.url ? this.url : window.location.href;
this.update();
this.startWatching();
},
methods: {
Expand All @@ -27,9 +37,9 @@
}, 60000); // 60 seconds
},
update() {
axios.post('/api/currently-viewing-page')
axios.post('/api/currently-viewing-page', { url: this.view_url })
.then((response) => {
this.users = response.data;
this.users = response.data.data;
});
}
}
Expand All @@ -38,6 +48,9 @@
</script>
<style>
.currentlyViewingPageWrapper {
position: fixed;
bottom: 10px;
right: 20px;
box-shadow: 4px 10px 26px -10px rgba(0,0,0,0.5)
}
</style>

0 comments on commit 62285cf

Please sign in to comment.