Vue
by Paul Leech
HTML
<!DOCTYPE html>
<html>
<head>
<title>Vue JS - Get Query Parameters Example - ItSolutionStuff.com</title>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script src="https://unpkg.com/vue-router"></script>
</head>
<body>
<div id="app">
</div>
</body>
</html>
CSS
body {
background: #20262E;
padding: 20px;
font-family: Helvetica;
}
#app {
background: #fff;
border-radius: 4px;
padding: 20px;
transition: all 0.2s;
}
li {
margin: 8px 0;
}
h2 {
font-weight: bold;
margin-bottom: 15px;
}
del {
color: rgba(0, 0, 0, 0.3);
}
Vue
/*
new Vue({
el: "#app",
data: {
todos: [
{ text: "Learn JavaScript", done: false },
{ text: "Learn Vue", done: false },
{ text: "Play around in JSFiddle", done: true },
{ text: "Build something awesome", done: true }
]
},
methods: {
toggle: function(todo){
todo.done = !todo.done
}
}
})
var router = new VueRouter({
mode: 'history',
routes: []
});
*/
var myApp = new Vue({
router,
el: '#app',
mounted: function() {
parameters = this.$route.query
console.log(parameters)
name = this.$route.query.name
console.log(name)
},
});