Comments (9)
环境是windows下的chrome
from vue-puzzle-vcode.
能贴一下你的代码吗
from vue-puzzle-vcode.
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.
看看是不是我用错了 我用on-success也没用
from vue-puzzle-vcode.
from vue-puzzle-vcode.
我配置了一个demo,没有发现问题,你可以看看:
https://codesandbox.io/s/dazzling-tesla-k80id
你看看你的项目中有没有任何错误提示信息
from vue-puzzle-vcode.
我试过了,用
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.
方便把你的代码直接发给我吗
我不太清楚你项目里是怎样配置的
我的邮箱:[email protected]
或者你放github上也行
from vue-puzzle-vcode.
问题的原因是vue在非<template>
中使用的话,不支持驼峰命名的事件
我发布了1.1.0版本,
改变了事件的名称:(去掉了前面的on)
现在你可以这样绑定事件:
<v-code @success="onSuccess" @close="onClose" />
from vue-puzzle-vcode.
Related Issues (20)
- Vue3.2.8用不了 HOT 2
- vue3 报错 图片显示不出来 无法拖动 HOT 6
- 鑫哥规划一下新功能,让我也加入贡献者吧 HOT 2
- body上的class影响全局 HOT 3
- 成功失败事件不触发 HOT 1
- 不能将类型“{ show: boolean; }”分配给类型“ComponentProps<number>”。 不能将类型“{ show: boolean; }”分配给类型“number”。ts(2322) HOT 5
- 自定义图片格式 HOT 1
- vite打包报错,vue3 HOT 1
- 运行webpack直接报错 HOT 8
- 建议增加一个classname的穿参,否则不太好更改top或者z-index,还有能加一个点击刷新按钮的回调函数吗 HOT 2
- nuxt3打包报错 HOT 3
- 在vue3中引入vant4组件库,点击遮罩层会相互影响 HOT 5
- nuxt3 样式丢失问题 HOT 2
- 只能是模态框的形式吗,想让其出现在指定div内应该如何操作 HOT 3
- 这个是免费的吗? HOT 3
- 滑动卡顿 HOT 1
- 请问vue3版本有开源吗? HOT 1
- 浏览器警告
- 滑块向右滑动的距离能返回给我们吗 HOT 2
- 能否加个关闭按钮
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-puzzle-vcode.