yes,you overrided correctly.
please make sure you are working on correct file. I mean please check in vendor changes reflecting on frontend or not as per your need. if yes then it should also work in your theme.
Make sure you cleared cache after override and given proper permission to file as per your server required.