vue raw html,javascript - Vuejs - Render raw html links to <router-link> - Stack Overflow

I;m new to VueJS and I'm making some weird experiments. I build a backend service using python/flask and this backend provide me a string of html code with many tags inside, I want to render this inside my Vue app, I have a method for calling the backend that looks like this:

async execute (method, resource, data) {

return client({

method,

url: resource,

data: data

}).then(async req => {

return req.data.html

})

},

callBack (id) {

console.log(id)

return this.execute('post', '/content/', {body: { 'id': id }})

}

And in the .vue file I have:

export default {

data () {

return {

loading: false,

launch: [],

html: 'none',

page: this.$route.params.article

}

},

beforeMount () {

console.log('beforeee')

this.html = api.callBack(this.page)

},

methods: {

async launch () {

this.launch = ''

this.html = await api.callBack(this.page)

}

}

}

so when I call the launch function it populates this.html, and this html variable lives in a v-html.Everything seems to work i get the html and render it in de container but the links are broken, the links should point at the same app something like #/test/linkvalue, but as they are tags, and in vue you have to use they doesn't work.

There is a way to achieve this "dynamic re route" or I'm doing something too weird?

The links are plenty, since they are scraped from the web, so manually parsing is not an option.

Thanks in advance for your help

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值