提交 2b215b0f 编写于 作者: D DCloud_LXH

fix: picker-view-column v-if 时有占位 question/132545

上级 db8a0695
......@@ -107,14 +107,13 @@ export default /*#__PURE__*/ defineBuiltInComponent({
let ColumnsPreRef: Ref<VNode[]> = ref([])
let columnsRef: Ref<VNode[] | HTMLCollection> = ref([])
function getItemIndex(vnode: VNode): number {
const columnVNodes = columnsRef.value
if (__PLATFORM__ === 'app' && columnVNodes instanceof HTMLCollection) {
return Array.prototype.indexOf.call(
columnVNodes as HTMLCollection,
vnode.el
)
const columnVNodes = (columnsRef.value as VNode[]).filter(
(ref) => typeof ref.type !== 'symbol'
)
if (__PLATFORM__ === 'app' && columnVNodes) {
return Array.prototype.indexOf.call(columnVNodes, vnode.el)
}
let index: number = (columnVNodes as VNode[]).indexOf(vnode)
let index: number = columnVNodes.indexOf(vnode)
return index !== -1 ? index : ColumnsPreRef.value.indexOf(vnode)
}
const getPickerViewColumn: GetPickerViewColumn = function (columnInstance) {
......
......@@ -4378,7 +4378,7 @@ var PickerView = /* @__PURE__ */ defineBuiltInComponent({
let ColumnsPreRef = vue.ref([]);
let columnsRef = vue.ref([]);
function getItemIndex(vnode) {
const columnVNodes = columnsRef.value;
const columnVNodes = columnsRef.value.filter((ref) => typeof ref.type !== "symbol");
let index2 = columnVNodes.indexOf(vnode);
return index2 !== -1 ? index2 : ColumnsPreRef.value.indexOf(vnode);
}
......
......@@ -10113,7 +10113,7 @@ var PickerView = /* @__PURE__ */ defineBuiltInComponent({
let ColumnsPreRef = ref([]);
let columnsRef = ref([]);
function getItemIndex(vnode) {
const columnVNodes = columnsRef.value;
const columnVNodes = columnsRef.value.filter((ref2) => typeof ref2.type !== "symbol");
let index2 = columnVNodes.indexOf(vnode);
return index2 !== -1 ? index2 : ColumnsPreRef.value.indexOf(vnode);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册