Message Boards
Remote app with vue issue
Remote app with vue issue
New Member Posts: 5 Join Date: 8/3/11 Recent PostsI used the liferay7.4 GA4 CE version
I added a remote app with vue in a page . Sometimes it was ok. Sometimes it got the blank,then I inspected the element,I got this bellow:
RE: Remote app with vue issue
Liferay Legend Posts: 6403 Join Date: 9/23/08 Recent PostsSome more steps to reproduce (e.g. how do you end up at this result) would be beneficial for answering.
RE: Remote app with vue issue
Junior Member Posts: 55 Join Date: 3/25/16 Recent PostsI have the same problem with my angular remote app.
If I go to the page with the menu link it is OK. But if I go directly with my browser or I do a refresh or I change the language, my remote app portlet is empty like you !
Do you solve your problem ?
I am in Liferay 7.4 GA38.
Thanks,
Eric.
RE: RE: Remote app with vue issue
New Member Posts: 5 Join Date: 8/14/22 Recent PostsHi!
The same issue & I've spent an entire day to find a solution. So, the main key in my case was that "HTML Element-Name" in a Remote app must be the same as you gave your app in the code.
Vue example (see: el: "company-remote-app",)
import Vue from 'vue'
import App from './App.vue'
import vuetify from './plugins/vuetify'
Vue.config.productionTip = false
new Vue({
el: "company-remote-app",
vuetify,
render: (h) => h(App),
}).$mount("departments-remote-app");
React example (see: const ELEMENT_ID = 'company-remote-app';)
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
class WebComponent extends HTMLElement {
connectedCallback() {
ReactDOM.render(<App />, this);
}
}
const ELEMENT_ID = 'company-remote-app';
if (!customElements.get(ELEMENT_ID)) {
customElements.define(ELEMENT_ID, WebComponent);
}
also see: https://liferay.dev/blogs/-/blogs/liferay-objects-and-remote-apps-how-can-we-connect-them-