Fixed format of events
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { menuData } from '../../config/menuData';
|
||||
import { mapState } from 'vuex';
|
||||
|
||||
export default {
|
||||
name: 'ImageContent',
|
||||
@@ -15,6 +15,9 @@ export default {
|
||||
currentImage: '/images/homepage1.png'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState(['menuData']),
|
||||
},
|
||||
watch: {
|
||||
$route: {
|
||||
immediate: true,
|
||||
@@ -26,6 +29,7 @@ export default {
|
||||
methods: {
|
||||
updateImage() {
|
||||
const routePath = this.$route.path;
|
||||
const menuData = this.menuData;
|
||||
const menuItem = this.findMenuItemByPath(menuData, routePath);
|
||||
if (menuItem && menuItem.image) {
|
||||
this.currentImage = `/images/${menuItem.image}`;
|
||||
|
||||
Reference in New Issue
Block a user