cartodb-4.42/lib/assets/javascripts/new-dashboard/bundles/header/components/RouterLink.js

23 lines
458 B
JavaScript
Raw Normal View History

2024-04-06 13:25:13 +08:00
import Vue from 'vue';
import getCARTOData from 'new-dashboard/store/utils/getCARTOData';
const CARTOData = getCARTOData();
const RouterLink = Vue.component(
'router-link',
{
template: '<a :href="url"><slot/></a>',
props: {
staticRoute: String
},
computed: {
url: function () {
const baseUrl = CARTOData.user_data.base_url;
return baseUrl + this.staticRoute;
}
}
}
);
export default RouterLink;