<template>
<p id="app">
<headers></headers>
<p class="tap">
<p class="tab-item">
<router-link to="/goods">第一项</router-link>
</p>
<p class="tab-item">
<router-link to="/ratings">第二项</router-link>
</p>
<p class="tab-item">
<router-link to="/seller">第三项</router-link>
</p>
<router-view></router-view>
</p>
</p>
</template>
<script>
import headers from './components/header/header';
export default {
components:{
headers
},
name: 'app',
};
</script>
This is the content of App.vue. In fact, the page display has been mounted as a tag, but clicking has no effect, and there is no effect of clicking to change components
<template>
<p id="goods">
<p @:click="say()">
ssssss
</p>
</p>
</template>
<script>
export default{
name:{
'goods'
},
method:{
say:{
console.log('sayhi');
}
}
}
</script>
This is the code for one of the routers. The other two are basically the same. How to get the effect?
1. Is the routing path correct?
2. The method is written wrong, methods
3. The function say( ){} or say: function(){} should be written below methods
4.@:click should be @click
0.0.00.00.