<script type="text/javascript">
const Foo = Vue.extend({
template: `<div id="testzy">
<div @click="change">test</div>
</div>`,
mounted: function() {
debugger;
},
methods: {
change() {
debugger;
},
}
});
const routes = [{
path: '/foo/:id',
component: Foo
}]
const router = new VueRouter({
routes // (缩写)相当于 routes: routes
})
const app = new Vue({
data: {
message: 'father',
msg1: "hello",
show: true
},
router, // (缩写)相当于 router: router
mounted: function() {
debugger;
alert(this.$data.message);
},
}).$mount('#app')
</script>
原文:https://www.cnblogs.com/cowboybusy/p/11434601.html