If you want to add product in minicart Magento 2 with Ajax, follow below way:
– Open addtocart.phtml file in your theme directory:
app/design/frontend///Magento_Catalog/templates/product/view
– Modify the bindSubmit function
{ "#product_addtocart_form": { "catalogAddToCart": { "bindSubmit": true } } }