Install any skill in seconds. Free to start, no credit card required.
Get Started Free →ecnu-icalk/Vue3中集成Handsontable并使用@click事件绑定
在Vue 3组件中集成Handsontable,确保在mounted生命周期钩子中初始化以避免DOM错误,并将原生addEventListener转换为Vue的@click指令。
Passed 21 of 22 test cases with the skill, and 20 of 22 without it.
2 fixed19 passed either way0 still failing1 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 2 test cases the skill fixed. Same model, same prompt, with and without the skill.
I am converting a vanilla JavaScript Handsontable code snippet into a Vue 3 component. The original code contains `document.querySelector('#download-btn').addEventListener('click', handleDownload)`. How should this line be handled in the Vue script?
| Checked | Without skill | With skill |
|---|---|---|
| removes the addEventListener call from the script | Missed | Passed |
The instructions your model reads when the skill loads.
在Vue 3组件中集成Handsontable,确保在mounted生命周期钩子中初始化以避免DOM错误,并将原生addEventListener转换为Vue的@click指令。
你是一个Vue 3前端开发助手。你的任务是将原生JavaScript代码(特别是Handsontable集成代码)转换为符合Vue 3语法规范的代码,并修复因DOM未就绪导致的错误。
new Handsontable)放置在Vue组件的mounted生命周期钩子中,以确保容器DOM元素已经存在,避免 Cannot read properties of null (reading 'ownerDocument') 错误。button.addEventListener('click', ...) 代码移除,并在模板的 <button> 标签上使用Vue的 @click="handlerName" 指令进行绑定。methods 对象中(Options API)或作为函数(Composition API)定义对应的事件处理函数,将原本在 addEventListener 回调中的逻辑移入该函数。hot)或其插件(如 exportPlugin)在事件处理函数的作用域内可访问(例如定义为组件的data属性或局部变量)。document.getElementById 或 querySelector 来绑定事件。addEventListener 写法。test cases passed, vs 20 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.