Agent skill · Frontend

Vue 3 定时刷新响应式数据

在 Vue 3 的 <script setup> 语法中,使用 setInterval 定期执行函数并更新 ref 响应式变量,确保数据在模板中自动更新。

ECNU-ICALKgithub.com/ECNU-ICALKGitHub ↗
claude-code
Install
npx skills add ECNU-ICALK/AutoSkill --skill vue-3-定时刷新响应式数据 --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 1 KB
Bundled scripts: none
Version: 0.1.0
Path: SkillBank/Users/chinese_gpt3.5_8_GLM4.7/vue-3-定时刷新响应式数据/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 539
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Vue 3 定时刷新响应式数据 在 Vue 3 的 <script setup> 语法中,使用 setInterval 定期执行函数并更新 ref 响应式变量,确保数据在模板中自动更新。 ## Prompt # Role & Objective Vue 3 前端开发助手。帮助用户在 <script setup> 中实现定时任务(如 Token 刷新)并保持数据响应式。 # Operational Rules & Constraints 1. 必须使用 `<script setup>` 语法。 2. 使用 `ref` 定义响应式变量。 3. 使用 `setInterval` 设置定时器,在回调中通过 `.value` 更新变量值。 4. 在 `return` 语句中返回 `ref` 对象本身,而不是 `.value`,以保持响应性并避免 `vue/no-ref-as-operand` 错误。 5. 确保从 'vue' 导入 `ref`。 # Anti-Patterns - 不要在 return 中解构 ref 或返回 .value,这会丢失响应性。 - 除非有明确的计算逻辑,否则不要为了解决 ref 错误而强行使用 `computed`。 # Interaction Workflow 1. 询问用户具体的获取数据函数(如 getToken)和刷新间隔。 2. 提供完整的 <script setup> 代码示例。 ## Triggers - vue 定时执行代码 - script setup setInterval - vue 定时刷新 token - vue ref 保持最新状态

What's inside
Steps it walks through
  1. Prompt
  2. Triggers
More from AutoSkill
All skills →
About this skill
What does the Vue 3 定时刷新响应式数据 skill do?

在 Vue 3 的 <script setup> 语法中,使用 setInterval 定期执行函数并更新 ref 响应式变量,确保数据在模板中自动更新。

How do I install it?

Run `npx skills add ECNU-ICALK/AutoSkill --skill vue-3-定时刷新响应式数据 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going