Files
hermes-desktop/tests/client/fixtures/script-setup-let-assignment.vue
T
toor 01d9e301fc
Build / build (push) Canceled after 0s
Playwright / browser (push) Canceled after 0s
initialize Electron desktop app and remove unused files
2026-10-25 01:09:01 +08:00

22 lines
616 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
// 测试夹具:验证 <script setup> 的 let 绑定在模板内联语句里能否写回。
// 与 McpManagerView.vue 的 `_autoRetryCount` 同一形态。
let counter = 0
const observed: number[] = []
function bump() {
counter++
observed.push(counter)
}
function read() {
observed.push(counter)
}
</script>
<template>
<button class="bump" @click="bump()">bump</button>
<!-- 先把 counter 推到非 0,再内联复位后读取 —— 这样「复位是否生效」才有区分度 -->
<button class="reset-read" @click="counter = 0; read()">reset+read</button>
</template>