dimanche 18 juillet 2021

Show markdown file in vuejs (markdown provided via backend link)

the markdown file link: http://127.0.0.1:8000/media/uploads/content/test_y4O7oOS.md

vue template:

<template>
  <div>
      
      
      
      
  </div>
</template>

vue methods:

methods: {
        async getArticleDetail() {
            const category_slug = this.$route.params.category_slug
            const article_slug = this.$route.params.article_slug

            await axios
                .get(`/api/${category_slug}/${article_slug}/`)
                .then(response => {
                    this.artilce = response.data
                    document.title = this.artilce.title
                })
                .catch(err => {
                    console.log(err)
                })
        }
    }



Aucun commentaire:

Enregistrer un commentaire