From c97714167de6e8ce75d1f362658f963a54ac996d Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 26 Mar 2019 15:57:08 +0000 Subject: [PATCH] Fix issues --- assets/js/app.js | 10 +++---- assets/js/components/Navbar.vue | 50 +++++++++++++++++++++++++-------- 2 files changed, 42 insertions(+), 18 deletions(-) diff --git a/assets/js/app.js b/assets/js/app.js index 9472da70..74f94215 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -1,9 +1,7 @@ -window.hljs = require('highlightjs') -window.Vue = require('vue') +import Navbar from './components/Navbar' +import Vue from 'vue' -import Navbar from './components/Navbar'; - -const app = new Vue({ +new Vue({ el: '#app', - components: { Navbar }, + components: { Navbar } }) diff --git a/assets/js/components/Navbar.vue b/assets/js/components/Navbar.vue index 5c5cc4a6..63207be9 100644 --- a/assets/js/components/Navbar.vue +++ b/assets/js/components/Navbar.vue @@ -4,15 +4,30 @@
-
@@ -23,7 +38,8 @@ role="navigation" > export default { props: { - siteUrl: String, - siteTitle: String, - pageUrl: String, - }, - - methods: { - isActive(item) { - return this.pageUrl.match(new RegExp(item.pattern)) + siteUrl: { + type: String, + required: true + }, + siteTitle: { + type: String, + required: true + }, + pageUrl: { + type: String, + required: true } }, @@ -97,5 +116,12 @@ export default { ], } }, + + + methods: { + isActive(item) { + return this.pageUrl.match(new RegExp(item.pattern)) + } + } }