Message Boards

Remote app with vue issue

gavin lau, modified 2 Years ago.

Remote app with vue issue

New Member Posts: 5 Join Date: 8/3/11 Recent Posts

I 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:

thumbnail
Olaf Kock, modified 2 Years ago.

RE: Remote app with vue issue

Liferay Legend Posts: 6403 Join Date: 9/23/08 Recent Posts

Some more steps to reproduce (e.g. how do you end up at this result) would be beneficial for answering.

thumbnail
Eric D, modified 1 Year ago.

RE: Remote app with vue issue

Junior Member Posts: 55 Join Date: 3/25/16 Recent Posts

I 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.

Go ID, modified 1 Year ago.

RE: RE: Remote app with vue issue

New Member Posts: 5 Join Date: 8/14/22 Recent Posts

Hi!

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-