CORS Error Vue Js

I want to ask about an error in getting API with the tomcat server to my Vue js server. Below is the detailed error
Cors Error

Here is the source code

Here is the source code of calling the API

The Tomcat localhost is running at port:8080 server while my Vue js is at port:8081

I already tried some solution by adding vue.config.js in my Vue JS project and by adding some code to the tomcat web.XML file

Here is the solution with vue.config.js

And here is the solution with adding some filter code to tomcat web.XML file