🐛(component): 🐛(component): 修复轮播组件由于getStyle Computed在编译之后造成的错误

This commit is contained in:
0o张不歪o0 2022-06-24 00:17:32 +08:00
parent 5ef3402f6f
commit 99dfd8a70a

View File

@ -28,10 +28,10 @@ const getStyle = computed<any>(() => {
for (let index = 0; index < allChild.length; index++) {
const element = allChild[index];
// @ts-ignore
if (element.__vnode.props["data-id"] === active.value) {
if (element.getAttribute("data-id") === active.value) {
activeIndex = index;
}
if (element.__vnode.props["data-id"] === props.id) {
if (element.getAttribute("data-id") === props.id) {
currentIndex = index;
}
}