I'm trying to create a file that has a computed method that would return a list of items, I originally used a js file that had a static version of my list but now I need to show the items depending on permissions.
This is the original file
const DISTRIBUTION_PAGES = [
{
label: "Países",
component: 'Distribution/Countries',
href: "/distribution/countries",
},
{
label: "Provincias",
component: 'Distribution/Provinces',
href: "/distribution/provinces",
},
{
label: "Cantones",
component: 'Distribution/Cantons',
href: "/distribution/cantons",
},
{
label: "Distritos",
component: 'Distribution/Districts',
href: "/distribution/districts",
},
];
export default DISTRIBUTION_PAGES;
I'm new to vue 3, this is what I have to test which is basically nothing. I did see that when accessing methods you have to use a ref but in this case it's not a real component with a template so I'm not sure where to put the ref exactly or if it even matters.
<script setup>
import {computed} from "vue";
const DIST_PAGES = computed(() => {
return 'here'
})
</script>
I would like to do something like this in the component where I need the list
import Pages from '@/...'
//use like
{{pages.DIST_PAGES}} or {{pages}}
How can I make this work?