cartodb/lib/assets/javascripts/new-dashboard/bundles/header/components/RouterLink.js
2020-06-15 10:58:47 +08:00

23 lines
458 B
JavaScript

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;