@zhencai/vue-focus-scope 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.js +1 -1
  2. package/package.json +8 -8
  3. package/readme.md +10 -10
package/index.js CHANGED
@@ -68,4 +68,4 @@ var s = {
68
68
  }
69
69
  });
70
70
  //#endregion
71
- export { c as FocusScope };
71
+ export { c as FocusScope, c as default };
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
- {
2
- "name": "@zhencai/vue-focus-scope",
3
- "main": "index.js",
4
- "version": "1.0.4",
5
- "module": "index.js",
6
- "peerDependencies": {
7
- "vue": "^3.0.0"
8
- }
1
+ {
2
+ "name": "@zhencai/vue-focus-scope",
3
+ "main": "index.js",
4
+ "version": "1.0.6",
5
+ "module": "index.js",
6
+ "peerDependencies": {
7
+ "vue": "^3.0.0"
8
+ }
9
9
  }
package/readme.md CHANGED
@@ -23,23 +23,25 @@
23
23
 
24
24
  ## 安装与使用
25
25
 
26
- 将组件代码保存为 `FocusLoop.vue`,然后在你的项目中引入。
26
+ ```vue
27
+ npm install @zhencai/vue-focus-scope
28
+ ```
27
29
 
28
30
  ### 基础用法
29
31
 
30
32
  ```vue
31
33
  <template>
32
- <FocusLoop>
34
+ <FocusScope>
33
35
  <h3>用户登录</h3>
34
36
  <input type="text" placeholder="用户名" />
35
37
  <input type="password" placeholder="密码" />
36
38
  <button @click="submit">登录</button>
37
39
  <a href="/forgot">忘记密码?</a>
38
- </FocusLoop>
40
+ </FocusScope>
39
41
  </template>
40
42
 
41
43
  <script setup lang="ts">
42
- import FocusLoop from "./components/FocusLoop.vue";
44
+ import FocusScope from "@zhencai/vue-focus-scope";
43
45
  </script>
44
46
  ```
45
47
 
@@ -50,14 +52,14 @@ import FocusLoop from "./components/FocusLoop.vue";
50
52
  ```vue
51
53
  <template>
52
54
  <!-- 强循环:焦点永远无法逃出此区域 -->
53
- <FocusLoop tab-mode="loop">
55
+ <FocusScope tab-mode="loop">
54
56
  <!-- 内容 -->
55
- </FocusLoop>
57
+ </FocusScope>
56
58
 
57
59
  <!-- 软循环:适合只有一个输入框或需要特殊逃逸逻辑的场景 -->
58
- <FocusLoop tab-mode="soft-loop">
60
+ <FocusScope tab-mode="soft-loop">
59
61
  <input type="text" placeholder="唯一输入框" />
60
- </FocusLoop>
62
+ </FocusScope>
61
63
  </template>
62
64
  ```
63
65
 
@@ -100,8 +102,6 @@ import FocusLoop from "./components/FocusLoop.vue";
100
102
 
101
103
  - **子元素要求**:确保插槽内的元素是原生的可聚焦元素(如 `<input>`, `<button>`, `<a href>`)或具有有效的 `tabindex`
102
104
 
103
- - **CSS 样式**:哨兵节点默认带有 `tabindex="0"` 但无视觉样式。如果需要,可以通过 CSS 类 `.sentinel-start` 或 `.sentinel-end` 进行调试(例如添加红色边框),但在生产环境中通常保持隐藏
104
-
105
105
  ## 许可证
106
106
 
107
107
  MIT