@zhencai/vue-focus-scope 1.0.7 → 1.0.9
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* My Library v1.0.0 */
|
|
2
|
-
import { createCommentVNode, createElementBlock, createElementVNode, defineComponent, openBlock, renderSlot, useTemplateRef, watch } from "vue";
|
|
2
|
+
import { createCommentVNode, createElementBlock, createElementVNode, defineComponent, nextTick, openBlock, renderSlot, useTemplateRef, watch } from "vue";
|
|
3
3
|
//#region src/components/FocusScope.vue?vue&type=script&setup=true&lang.ts
|
|
4
4
|
var _hoisted_1 = {
|
|
5
5
|
key: 0,
|
|
@@ -13,7 +13,7 @@ var FocusScope_default = /* @__PURE__ */ defineComponent({
|
|
|
13
13
|
tabMode: { default: "loop" },
|
|
14
14
|
autofocus: {
|
|
15
15
|
type: Boolean,
|
|
16
|
-
default:
|
|
16
|
+
default: false
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
setup(__props) {
|
|
@@ -135,8 +135,11 @@ var FocusScope_default = /* @__PURE__ */ defineComponent({
|
|
|
135
135
|
* - 表单显示时自动聚焦第一个字段
|
|
136
136
|
* - 动态切换焦点作用域时重新聚焦
|
|
137
137
|
*/
|
|
138
|
-
watch(() => props.autofocus, (newValue) => {
|
|
139
|
-
if (newValue === true)
|
|
138
|
+
watch(() => props.autofocus, async (newValue) => {
|
|
139
|
+
if (newValue === true) {
|
|
140
|
+
await nextTick();
|
|
141
|
+
focusFirst();
|
|
142
|
+
}
|
|
140
143
|
}, { immediate: true });
|
|
141
144
|
return (_ctx, _cache) => {
|
|
142
145
|
return openBlock(), createElementBlock("div", {
|
package/package.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhencai/vue-focus-scope",
|
|
3
|
-
"
|
|
4
|
-
"version": "1.0.
|
|
5
|
-
"module": "index.js",
|
|
3
|
+
"module": "FocusScope.js",
|
|
4
|
+
"version": "1.0.9",
|
|
6
5
|
"peerDependencies": {
|
|
7
6
|
"vue": "^3.0.0"
|
|
8
|
-
}
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"README.md",
|
|
11
|
+
"LICENSE"
|
|
12
|
+
],
|
|
13
|
+
"license": "MIT"
|
|
9
14
|
}
|
|
File without changes
|