javascript - Why does my router-link in vue not work?
漂亮男人
漂亮男人 2017-05-16 13:38:06
0
2
681
<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?

漂亮男人
漂亮男人

reply all(2)
黄舟

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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template