Giter Club home page Giter Club logo

Comments (9)

wsy998 avatar wsy998 commented on July 19, 2024

环境是windows下的chrome

from vue-puzzle-vcode.

javaLuo avatar javaLuo commented on July 19, 2024

能贴一下你的代码吗

from vue-puzzle-vcode.

wsy998 avatar wsy998 commented on July 19, 2024

html代码

<v-code :show="isShow" @onSuccess="onSuccess" @onClose="onClose" />

js代码

Vue.component("v-code", Vcode);
new Vue({
  el: "#app",
  data: { isShow: true },
  methods: {
    onSuccess() {
      alert("成功");
      this.isShow = false;
    },
    onClose() {
      alert("关闭");
      this.isShow = false;
    }
  }
});

from vue-puzzle-vcode.

wsy998 avatar wsy998 commented on July 19, 2024

看看是不是我用错了 我用on-success也没用

from vue-puzzle-vcode.

onclose avatar onclose commented on July 19, 2024

from vue-puzzle-vcode.

javaLuo avatar javaLuo commented on July 19, 2024

我配置了一个demo,没有发现问题,你可以看看:
https://codesandbox.io/s/dazzling-tesla-k80id

你看看你的项目中有没有任何错误提示信息

from vue-puzzle-vcode.

wsy998 avatar wsy998 commented on July 19, 2024

我试过了,用

new Vue({
  render: h => h(App)
}).$mount("#app");

但这个是不行的

new Vue({
  el: "#app",
  data: {
    isShow: true
  },
  methods: {
    onSuccess() {
      alert("success");
      this.isShow = false;
    },
    onClose() {
      alert("close");
      this.isShow = false;
    }
  }
});

from vue-puzzle-vcode.

javaLuo avatar javaLuo commented on July 19, 2024

方便把你的代码直接发给我吗
我不太清楚你项目里是怎样配置的
我的邮箱:[email protected]
或者你放github上也行

from vue-puzzle-vcode.

javaLuo avatar javaLuo commented on July 19, 2024

问题的原因是vue在非<template>中使用的话,不支持驼峰命名的事件

我发布了1.1.0版本,
改变了事件的名称:(去掉了前面的on)
现在你可以这样绑定事件:

<v-code @success="onSuccess" @close="onClose" />

from vue-puzzle-vcode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.