We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3130c3d commit 7ae74fcCopy full SHA for 7ae74fc
src/components/CustomControl.vue
@@ -62,6 +62,7 @@ export default defineComponent({
62
const addControl = (controlPosition: IControlPosition) => {
63
if (map.value && api.value && controlRef.value) {
64
const position = api.value.ControlPosition[controlPosition];
65
+ (controlRef.value as ControlRef).index = props.index;
66
map.value.controls[position].push(controlRef.value);
67
}
68
};
@@ -97,7 +98,9 @@ export default defineComponent({
97
98
watch(
99
() => props.index,
100
(newIndex) => {
- if (newIndex && controlRef.value) (controlRef.value as ControlRef).index = props.index;
101
+ if (!controlRef.value) return;
102
+
103
+ (controlRef.value as ControlRef).index = newIndex;
104
105
);
106
0 commit comments