I believe the below code is illegal in both ES6 and ES5.
const app = new Vue({router}).$mount('#app')
Since {router} is wrong, but this example is successfully executed here.
Can you help explain what syntax is this? What did I miss?
I believe the below code is illegal in both ES6 and ES5.
const app = new Vue({router}).$mount('#app')
Since {router} is wrong, but this example is successfully executed here.
Can you help explain what syntax is this? What did I miss?
The pattern creates an object having the property of "routes"
with value of array routes.
const routes = [
{ path: '/foo', component: "Foo" },
{ path: '/bar', component: "Bar" }
]
function props(prop) {
console.log(prop)
}
props({routes});