Page 1 of 1

Load docuvieware with VueJS Framework

Posted: Wed Apr 26, 2017 1:30 pm
by liliputien
Hi every body,

Does anybody have experience with docuvieware and VueJS. I try to load docuvieware component in vue, but it doesn't work ....

I use HTML directive (v-html) to show the HTML code of docuvieware. In source code I show the htmlContent I give with my backend, but in my browser, not any more ...

Thanks for your help.

Have a good day.

Re: Load docuvieware with VueJS Framework

Posted: Tue Feb 13, 2018 4:18 pm
by liliputien
I found a solution :

In your component, exec your request to get controller :"http://adresse_IP:port/api/DocuViewareREST/GetDocuViewareControl", docuViewareConfig)

When success, get content controller and save in data :
let content =["HtmlContent"]
this.DVComponent = content (=> use v-html directive with data pass)

Next is the trick to start controller :
this.$nextTick(function() {
let re = /<script\b[^>]*>([\s\S]*?)<\/script>/gm;
let scripts = re.exec(content);

Attempt nextick about this controller, extract the javascript about content given and eval it to exec javascript.

It's more complex about angular, but it's done the job.

Have fun