1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
require('../../../utils/index.js');
var shared = require('@vue/shared');
var vnode = require('../../../utils/vue/vnode.js');
var ElTourSteps = vue.defineComponent({
name: "ElTourSteps",
props: {
current: {
type: Number,
default: 0
}
},
emits: ["update-total"],
setup(props, { slots, emit }) {
let cacheTotal = 0;
return () => {
var _a, _b;
const children = (_a = slots.default) == null ? void 0 : _a.call(slots);
const result = [];
let total = 0;
function filterSteps(children2) {
if (!shared.isArray(children2))
return;
children2.forEach((item) => {
var _a2;
const name = (_a2 = (item == null ? void 0 : item.type) || {}) == null ? void 0 : _a2.name;
if (name === "ElTourStep") {
result.push(item);
total += 1;
}
});
}
if (children.length) {
filterSteps(vnode.flattedChildren((_b = children[0]) == null ? void 0 : _b.children));
}
if (cacheTotal !== total) {
cacheTotal = total;
emit("update-total", total);
}
if (result.length) {
return result[props.current];
}
return null;
};
}
});
exports["default"] = ElTourSteps;
//# sourceMappingURL=steps.js.map