I'm looking to make the localhost in my code dynamic instead of hardcoded. Here's the original code:
export default {
data: function()
{
return {
localhost: "http://10.10.10.132/",
};
},
}
Could it be changed to something like this?
export default {
data: function()
{
return {
localhost: window.location.host,
};
},
}
However, when I use
localhost: window.location.host
My API request ends up duplicated - Thanks.