You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>By passing <code>namespace = JsPackage.GLOBAL</code> we tell GWT that the JS Constructor is on Window directly.
1087
-
If your JS Constructor is in an object <code>ComponentsBundle</code> on Window, then pass <code>namespace = "ComponentsBundle"</code>.
1088
-
You can also pass <code>name = "MyJSName"</code> to indicate the name of your JS Constructor, if it differs from your Java Class name.</p>
1063
+
<h4id="how-does-jscomponent-find-the-existing-js-component">How does <code>@JsComponent</code> find the existing JS Component?</h4>
1064
+
<p>You may have noticed we also pass <code>"FullJsWithMethodsComponent"</code> to our <code>@JsComponent</code> annotation.
1065
+
This is used to find the Js Component on <code>window</code>.</p>
1066
+
<p>So if you put <code>@JsComponent("MyVueLib.MyComponent")</code>, it will link your <code>JsComponent</code> class to: <code>window.MyVueLib.MyComponent</code>.</p>
1067
+
<h4id="what-if-the-js-library-exposes-a-component-options-object">What if the JS library exposes a Component options object?</h4>
1068
+
<p>Some libraries like <ahref="http://vue-chartjs.org/" target="_blank">Vue ChartJS</a> exposes a Component options object and not a Component Constructor.
1069
+
You can use the same method, and Vue GWT will automatically create a Vue Component constructor from those options for you.
1070
+
The only change is you have to tell GWT that the instance is an <code>Object</code> and not a <code>Function</code>:</p>
<h3id="using-our-js-component-in-a-java-one">Using Our JS Component in a Java One</h3>
1090
1076
<p>You can use your JS Component just like the Java ones.
1091
1077
Which means you can also pass them to the <code>@Component</code> annotation <ahref="../essential/components.html#using-components">as local components</a>:</p>
gitbook.page.hasChanged({"page":{"title":"Integrating With JS Components","level":"8.1","depth":1,"next":{"title":"Using JS Components in Java","level":"8.1.1","depth":2,"anchor":"#using-js-components-in-java","path":"advanced/integrating-with-js-components.md","ref":"advanced/integrating-with-js-components.md#using-js-components-in-java","articles":[]},"previous":{"title":"Routing","level":"7.1","depth":1,"path":"scaling-up/routing.md","ref":"scaling-up/routing.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["include","toggle-chapters"],"pluginsConfig":{"include":{},"toggle-chapters":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"advanced/integrating-with-js-components.md","mtime":"2017-09-10T17:55:25.000Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-10-10T15:06:21.162Z"},"basePath":"..","book":{"language":""}});
1139
+
gitbook.page.hasChanged({"page":{"title":"Integrating With JS Components","level":"8.1","depth":1,"next":{"title":"Using JS Components in Java","level":"8.1.1","depth":2,"anchor":"#using-js-components-in-java","path":"advanced/integrating-with-js-components.md","ref":"advanced/integrating-with-js-components.md#using-js-components-in-java","articles":[]},"previous":{"title":"Routing","level":"7.1","depth":1,"path":"scaling-up/routing.md","ref":"scaling-up/routing.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["include","toggle-chapters"],"pluginsConfig":{"include":{},"toggle-chapters":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"advanced/integrating-with-js-components.md","mtime":"2017-11-18T09:24:57.571Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-11-18T11:51:52.642Z"},"basePath":"..","book":{"language":""}});
0 commit comments