I think It depends, in part, upon what kind of work you do and what kind of drugs you're taking to manage your pain; but yes, you could most likely manage a few hours of computer work, via a laptop, a few weeks after surgery. I was able to video conference for about an hour three weeks after surgery, but I wasn't happy about it. I also did some minor editing and statistical analysis at that time using my laptop. Jack is right, you'll be able to do it.
That being said, I have a slightly different take on work after major surgery, and joint replacement is major surgery. I'm still on disability. I'm enjoying my time off and I'm in no hurry to get back to work. It will still be there when I return and it will go on long after I'm gone. My disability time is ME time, I enjoy my daily walks, they're fun and I'm up to 3+ miles already! Take as much time as you can possibly afford to heal. Your body will thank you for it.
Good luck! You are going to feel so much better.