diff --git a/components/app.vue b/components/app.vue
index d300780..b81436a 100644
--- a/components/app.vue
+++ b/components/app.vue
@@ -1,12 +1,13 @@
-
+
+{{active}}, {{hash}}
+
-
@@ -22,12 +23,32 @@ const user = {
status: 1,
}
+function active() {
+ if (this.hash == '' || this.hash == '#') {
+ return 1
+ } else if (/^#new\/?/.exec(this.hash)) {
+ return 2
+ } else if (/^#estimates\/?/.exec(this.hash)) {
+ return 3
+ } else if (/^#settings\/?/.exec(this.hash)) {
+ return 4
+ } else if (/^#sign-out\/?/.exec(this.hash)) {
+ return 5
+ } else {
+ return 0
+ }
+}
+
export default {
components: {SideBar},
+ computed: {active},
data() {
return {
- loading: true, user: user
+ loading: true, user: user, hash: ''
}
+ },
+ created() {
+ window.onhashchange = () => this.hash = window.location.hash
}
}
diff --git a/components/sidebar.vue b/components/sidebar.vue
index 1cbbb74..84ff09f 100644
--- a/components/sidebar.vue
+++ b/components/sidebar.vue
@@ -3,7 +3,7 @@
-
+
Home
-
+
-
+
New
-
+
-
+
Estimates
-
+
-
+
Settings
-
+
-
+
Sign out
-
+
diff --git a/main.js b/main.js
index 24adc3c..0d78849 100644
--- a/main.js
+++ b/main.js
@@ -2,4 +2,4 @@ import {createApp} from "vue"
import App from "./components/app.vue"
import "./assets/main.css"
-createApp(App).mount("#app")
+const app = createApp(App).mount("#app")
diff --git a/webpack.config.js b/webpack.config.js
index f25ebd0..875577b 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -22,6 +22,7 @@ module.exports = {
}
}
},
+ devtool: 'inline-source-map',
// Required for also applying rules to sections of SFC
plugins: [new VueLoaderPlugin()],
};