Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vuxt/express 部署到服务器上了但是我绑定了一个点击事件并不会执行 #2

Open
notCoolBean opened this issue Oct 19, 2017 · 1 comment

Comments

@notCoolBean
Copy link

notCoolBean commented Oct 19, 2017

<template>
  <section class="container">
    <img src="~assets/img/logo.png" alt="Nuxt.js Logo" class="logo" />
    <h1 class="title" @click="log">
      USERS1
    </h1>
    <ul class="users">
      <li v-for="(user, index) in users" :key="index" class="user">
        <nuxt-link :to="{ name: 'id', params: { id: index }}">
          {{ user.name }}
        </nuxt-link>
      </li>
    </ul>
  </section>
</template>

<script>
import axios from '~/plugins/axios'

export default {
  async asyncData () {
    let { data } = await axios.get('/api/users')
    return { users: data }
  },
  head () {
    return {
      title: 'Users'
    }
  },
  methods: {
    log () {
      console.log('111112222')
    }
  }
}
</script>

这是我的代码 能帮我看一下吗?我看您的首页也有一个点击事件不知道为什么我的触发不了

@bimohxh
Copy link
Member

bimohxh commented Oct 20, 2017

methods: {
    log () {
      console.log('111112222')
    }
  }

应该是

methods: {
    log: function () {
      console.log('111112222')
    }
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants