options: {
markdownIt: {
linkify: true
},
linkAttributes: {
attrs: {
target: "_self",
rel: "noopener"
}
}
}
};
},
async setup (props) {
const {
bundle
} = toRefs(props);
const source = ref(null);
const getReadme = async (bundle) => {
const url = `/documentation/${bundle}/readme`;
return fetch(url, {
credentials: "include",
headers: {
"Accept": "application/json",
"Content-Type": "application/json",
"User-Agent": "nodefony"
}
})
.then(async (response) => {
try {
if (response.ok) {
return await response.json();
}
} catch (error) {
error.response = response;
throw error;
}
const error = new Error(response.statusText);
error.response = await response.json();
throw error;
});
};
if (bundle.value) {
const res = await getReadme(bundle.value);
if (res.readme) {
source.value = res.readme;
}
}
return {
bundle,
source
};
},
beforeMount () {},
mounted () {},
methods: {}
};
@import 'highlight.js/styles/github-dark.css';