Skip to content

Commit

Permalink
feat(application): update document title with app title
Browse files Browse the repository at this point in the history
  • Loading branch information
leomp12 committed Apr 1, 2021
1 parent 0fb7acd commit 7c9b88e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/views/Application.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div id="application">
<ec-application
:application="application"
:application.sync="application"
@click:back="goToMarket"
@install="onInstall"
@uninstall="goToMarket"
Expand Down
16 changes: 12 additions & 4 deletions src/views/js/Application.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ export default {
EcApplication
},

computed: {
application () {
return {
data () {
return {
application: {
app_id: this.$route.params.appId,
_id: this.$route.params.objectId
_id: this.$route.params.objectId,
title: ''
}
}
},
Expand All @@ -32,5 +33,12 @@ export default {
name: 'marketplace'
})
}
},

watch: {
'application.title' (appTitle) {
const pageTitle = document.title.replace(/\[[^]+\]\s·\s/, '')
document.title = `[${appTitle.replace(/[[\]]/, '-')}] · ${pageTitle}`
}
}
}

0 comments on commit 7c9b88e

Please # to comment.