基于antd-v4.0版本的锚点使用

234 阅读1分钟

这是一些组件,组件的id写在组件里面,这个东西是一定要绑定id的 image.png

<a-anchor direction="horizontal" :affix="false" :getContainer="getContainer" @click="handleNavClick" :items="menus">
</a-anchor>

const getContainer = () => {
    return document.querySelector(".management-body");
};
const handleNavClick = (e: MouseEvent) => {
    e.preventDefault();
};
const menus = ref<any>(
    [
        {title: '招标信息', key: 'tenderInformation', href: '#tenderInformation' },
        {title: '响应文件', key: 'tenderRules', href: '#tenderRules'  },
        {title: '采购内容', key: 'procurementContent', href: '#procurementContent'  },
        {title: '答疑澄清', key: 'qAClarification', href: '#qAClarification'  },
        {title: '清单明细', key: 'inventoryDetails', href: '#inventoryDetails'  },
        {title: '执行进程', key: 'executeTheProcess', href: '#executeTheProcess'  },
    ]
)