uniapp/uvue中input组件,如何同时传event事件以及参数
![2***@qq.com](https://img-cdn-tc.dcloud.net.cn/account/identicon/2d520aa17f2e9972029730c55134a50c.png)
2***@qq.com
- 发布:2024-08-26 03:31
- 更新:2024-08-26 16:45
- 阅读:195
uniapp/uvue中input组件,如何同时传event事件以及参数
分类:uni-app x
![DCloud_UNI_yuhe](http://img-cdn-tc.dcloud.net.cn/uploads/avatar/002/60/98/28_avatar_mid.jpg?v=1719552003)
给你提供一下示例,你看一下是否是你需要的效果:
<template>
<!-- #ifdef APP -->
<scroll-view style="flex:1">
<!-- #endif -->
<input type="text" v-model="input" @input="change($event as UniInputEvent,'yuhe')" />
<!-- #ifdef APP -->
</scroll-view>
<!-- #endif -->
</template>
<script setup>
const input = ref('')
const change = (event:UniInputEvent,name:string)=>{
console.log(event)
console.log(name)
}
</script>
<style>
</style>
2***@qq.com (作者)
谢谢,是我需要的,event漏了$,昨晚我在想是不是要$event。
2024-08-27 15:00