Skip to content

Commit 515121e

Browse files
committed
rendering the app into a static main dom node
1 parent 401f172 commit 515121e

File tree

3 files changed

+18
-23
lines changed

3 files changed

+18
-23
lines changed

frameworks/keyed/neomjs/apps/neoapp/app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const onStart = () => Neo.app({
44
appPath : 'apps/neoapp/',
55
mainView: MainComponent,
66
name : 'NeoApp',
7-
renderTo: 'document.body'
7+
parentId: 'main'
88
});
99

1010
export {onStart as onStart};

frameworks/keyed/neomjs/apps/neoapp/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<link href="/css/currentStyle.css" rel="stylesheet"/>
77
</head>
88
<body>
9+
<div id="main"></div>
910
<script src="../../src/MicroLoader.mjs" type="module"></script>
1011
</body>
1112
</html>

frameworks/keyed/neomjs/apps/neoapp/view/MainComponent.mjs

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ class MainComponent extends Base {
1919
* @member {Boolean} autoMount=true
2020
*/
2121
autoMount: true,
22+
/**
23+
* @member {String[]} cls=['container']
24+
*/
25+
cls: ['container'],
2226
/**
2327
* @member {Neo.controller.Component} controller=MainComponentController
2428
*/
@@ -39,22 +43,20 @@ class MainComponent extends Base {
3943
* @member {Object} _vdom
4044
*/
4145
_vdom:
42-
{cn: [
43-
{cls: ['container'], cn: [
44-
{cls: ['jumbotron'], cn: [
45-
{cls: ['row'], cn: [
46-
{cls: ['col-md-6'], cn: [
47-
{cls: ['row'], cn: [
48-
{tag: 'h1', html: 'neo.mjs'}
49-
]}
50-
]},
51-
{cls: ['col-md-6'], cn: [
52-
{cls: ['row'], flag: 'row', cn: []}
46+
{cls: ['container'], cn: [
47+
{cls: ['jumbotron'], cn: [
48+
{cls: ['row'], cn: [
49+
{cls: ['col-md-6'], cn: [
50+
{cls: ['row'], cn: [
51+
{tag: 'h1', html: 'neo.mjs'}
5352
]}
53+
]},
54+
{cls: ['col-md-6'], cn: [
55+
{cls: ['row'], flag: 'row', cn: []}
5456
]}
55-
]},
56-
{tag: 'span', cls: ['preloadicon', 'glyphicon', 'glyphicon-remove'], 'aria-hidden': true}
57-
]}
57+
]}
58+
]},
59+
{tag: 'span', cls: ['preloadicon', 'glyphicon', 'glyphicon-remove'], 'aria-hidden': true}
5860
]}
5961
}}
6062

@@ -117,14 +119,6 @@ class MainComponent extends Base {
117119

118120
me.vdom = vdom;
119121
}
120-
121-
/**
122-
* Mean override. It is tricky to customise top level app component ids (todo).
123-
* @param {String} id
124-
*/
125-
createId(id) {
126-
super.createId('main');
127-
}
128122
}
129123

130124
Neo.applyClassConfig(MainComponent);

0 commit comments

Comments
 (0)