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

megalo@0.5.0 遍历组件,组件里的点击事件失效 #54

Closed
auven opened this issue Dec 2, 2018 · 1 comment
Closed

megalo@0.5.0 遍历组件,组件里的点击事件失效 #54

auven opened this issue Dec 2, 2018 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@auven
Copy link

auven commented Dec 2, 2018

代码复现

/megalo-demo/src/packageA/pages/a/components/ComA.vue

<template>
  <div @tap="handleTap">点击我{{ index }}</div>
</template>

<script>
export default {
  props: {
    index: Number
  },
  methods: {
    handleTap() {
      console.log("点击了:", this.index);
    }
  }
};
</script>

<style>
</style>

/megalo-demo/src/packageA/pages/a/index.vue

<template>
  <div class="app">
    <div>v-for 组件,组件里的点击事件失效</div>
    <com-a v-for="n in 9" :key="n" :index="n"/>
    <div v-for="n in 9" :key="n" @tap="handleTap(n)">点击我---{{ n }}</div>
  </div>
</template>

<script>
import ComA from "./components/ComA";
export default {
  components: {
    ComA
  },
  methods: {
    handleTap(i) {
      console.log('点击了---' + i)
    }
  }
};
</script>

<style lang="less" scoped>
</style>

问题现象

组件ComA里的点击事件失效了

版本

  • megalo@0.5.0
  • @megalo/template-compiler@0.5.0
  • @megalo/target@0.4.5

操作系统

  • mac 10.14.1
@elcarim5efil elcarim5efil added the bug Something isn't working label Dec 2, 2018
@elcarim5efil elcarim5efil self-assigned this Dec 2, 2018
elcarim5efil added a commit that referenced this issue Dec 2, 2018
@elcarim5efil
Copy link
Member

elcarim5efil commented Dec 2, 2018

megalo@0.5.1 @megalo/template-compiler@0.5.1
支持

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants