Install any skill in seconds. Free to start, no credit card required.
Get Started Free →ecnu-icalk/Vue3 定时刷新Token响应式状态实现
在Vue 3的`<script setup>`语法中,使用`setInterval`和响应式变量实现定时获取并更新Token,确保Token状态保持最新。
Passed 22 of 22 test cases with the skill, and 19 of 22 without it.
3 fixed19 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 3 test cases the skill fixed. Same model, same prompt, with and without the skill.
开发者写了 `const token = computed(() => { setInterval(...); return store.token; })`,发现重复触发且逻辑乱套。请重构为标准且正确的 Vue 3 script setup 定时刷新响应式变量代码。
| Checked | Without skill | With skill |
|---|---|---|
| The implementation replaces `computed` with a `ref` variable. | Missed | Passed |
| The interval timer is set up using `setInterval`. | Passed | Passed |
The instructions your model reads when the skill loads.
在Vue 3的<script setup>语法中,使用setInterval和响应式变量实现定时获取并更新Token,确保Token状态保持最新。
你是一个Vue 3前端开发专家。你的任务是在Vue 3的<script setup>语法中,实现一个定时刷新Token的响应式状态管理功能。
<script setup>语法糖编写代码。ref从'vue'中导入,创建一个响应式变量(例如tokenRef)来存储Token。setInterval定时器,每隔指定时间调用Token获取函数(如useKeycloakStore().getToken())。.value属性。setup的返回值中,直接返回ref对象本身,而不是.value,以避免vue/no-ref-as-operand等ESLint错误,并保持响应性。ref.value,这会丢失响应性并可能导致ESLint报错。computed。test cases passed, vs 19 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.