@soleil-se/app-util 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +5 -2
- package/package.json +1 -1
- package/src/index.js +12 -2
package/dist/index.js
CHANGED
|
@@ -59,8 +59,11 @@ export function renderVue(name, data, ref) {
|
|
|
59
59
|
|
|
60
60
|
var options = Object.assign({}, {webapp: app, isOffline: isOffline}, data);
|
|
61
61
|
var vueUri = getResourceUri('vue/index.js');
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
|
|
63
|
+
if (isOffline) {
|
|
64
|
+
return ("\n<!-- Generated by WebappUtil.renderVue() -->\n<div data-vue-portlet=\"" + portletId + "\">" + noScript + "</div>\n<script src=\"" + vueUri + "\"></script>\n<script> \n vueApps['" + name + "'].render('" + name + "', '" + selector + "', " + (JSON.stringify(options)) + ");\n</script>\n");
|
|
65
|
+
}
|
|
66
|
+
return ("\n<!-- Generated by WebappUtil.renderVue() -->\n<div data-vue-portlet=\"" + portletId + "\">" + noScript + "</div>\n<script>\n function renderVue" + portletId + "() {\n vueApps['" + name + "'].render('" + name + "', '" + selector + "', " + (JSON.stringify(options)) + ");\n } \n</script>\n<script src=\"" + vueUri + "\" " + (async && !defer ? 'async' : '') + " " + (defer ? 'defer' : '') + " onload=\"renderVue" + portletId + "();\"></script>\n");
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
/**
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -56,7 +56,18 @@ export function renderVue(name, data, {
|
|
|
56
56
|
} = {}) {
|
|
57
57
|
const options = { webapp: app, isOffline, ...data };
|
|
58
58
|
const vueUri = getResourceUri('vue/index.js');
|
|
59
|
-
|
|
59
|
+
|
|
60
|
+
if (isOffline) {
|
|
61
|
+
return `
|
|
62
|
+
<!-- Generated by WebappUtil.renderVue() -->
|
|
63
|
+
<div data-vue-portlet="${portletId}">${noScript}</div>
|
|
64
|
+
<script src="${vueUri}"></script>
|
|
65
|
+
<script>
|
|
66
|
+
vueApps['${name}'].render('${name}', '${selector}', ${JSON.stringify(options)});
|
|
67
|
+
</script>
|
|
68
|
+
`;
|
|
69
|
+
}
|
|
70
|
+
return `
|
|
60
71
|
<!-- Generated by WebappUtil.renderVue() -->
|
|
61
72
|
<div data-vue-portlet="${portletId}">${noScript}</div>
|
|
62
73
|
<script>
|
|
@@ -66,7 +77,6 @@ export function renderVue(name, data, {
|
|
|
66
77
|
</script>
|
|
67
78
|
<script src="${vueUri}" ${async && !defer ? 'async' : ''} ${defer ? 'defer' : ''} onload="renderVue${portletId}();"></script>
|
|
68
79
|
`;
|
|
69
|
-
return html;
|
|
70
80
|
}
|
|
71
81
|
|
|
72
82
|
/**
|