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.
Load docuvieware with VueJS Framework
-
- Posts: 2
- Joined: Wed Apr 26, 2017 1:24 pm
Re: Load docuvieware with VueJS Framework
I found a solution :
In your component, exec your request to get controller :
Vue.http.post("http://adresse_IP:port/api/DocuViewareREST/GetDocuViewareControl", docuViewareConfig)
When success, get content controller and save in data :
let content = success.data["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);
eval(scripts[1])
})
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
In your component, exec your request to get controller :
Vue.http.post("http://adresse_IP:port/api/DocuViewareREST/GetDocuViewareControl", docuViewareConfig)
When success, get content controller and save in data :
let content = success.data["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);
eval(scripts[1])
})
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
Who is online
Users browsing this forum: No registered users and 1 guest