When you try to access a resource in same domain, say localhost, the methods go through easily, but when you try to access anything outside the domain, ex: localhost:8080 (VueJS app) is trying to request resource on server mydomain.com (PHP code), the access is block to prevent cross-origin access. This is a security measure.
In order to resolve requests from trusted domain, you need to provide access control headers. Try something like this