Comments (7)
@adrienbaron Thanks! Will try it in the morning.
from vue-gwt.
Hi!
For you first component: BoilingVerdict.html
, it must have a single root element (that's a Vue.js constraint), maybe we should fire an error when it's not the case.
First question: You don't have to! This should work just fine:
<div>
<TemperatureInput scale="c" v-model="celsius" />
<TemperatureInput scale="f" v-model="fahrenheit" />
<BoilingVerdict :celsius="celsius" />
</div>
Second question: You also don't have to π, just declaring the dependency locally in @Component(components = { BoilingVerdict.class, TemperatureInput.class })
should be enough.
You can change your app class to:
Vue.attach("#temperatureCalcContainer", TemperatureCalc.class);
If you have other questions you can also ask them on our Gitter: https://gitter.im/Axellience/vue-gwt
from vue-gwt.
@adrienbaron Strange, but I have components = { BoilingVerdict.class, TemperatureInput.class ) in my code, and have to register all components manually anyway.
from vue-gwt.
Oh! I see what's happing, sorry I'm not awake yet ;). So the name in your template is not the name of your java class but that name converted to kebab-case.
See How Is the Component HTML Name Set? in https://axellience.github.io/vue-gwt/introduction/#composing-with-components
So:
<div>
<temperature-input scale="c" v-model="celsius" />
<temperature-input scale="f" v-model="fahrenheit" />
<boiling-verdict :celsius="celsius" />
</div>
from vue-gwt.
@adrienbaron Just checked your proposed solution. It works, and yes, it was HTML naming convention problem.
And I have NOT added single root for BoilingVerdict.html, so not sure "it must have a single root element (that's a Vue.js constraint)" is really mandatory.
from vue-gwt.
@adrienbaron Answering to myself :-) Yes, single root is mandatory, in my case:
<p v-if="parseFloat(celsius) >= 100">The water would boil.</p>
<p v-else>The water would not boil.</p>
works without single root only because one of paragraphs could be visible, not both.
If I add another element, then single root is immediately required, for example:
<div>
<div>Decision:</div>
<p v-if="parseFloat(celsius) >= 100">The water would boil.</p>
<p v-else>The water would not boil.</p>
</div>
from vue-gwt.
Great! Thanks for the details π! Closing the issue π
from vue-gwt.
Related Issues (20)
- Use vue-gwt to develop eclipse plugin HOT 1
- Demo Project is busted HOT 8
- Example of using an existing VueJS component library HOT 1
- Vue-GWT plugin not supported in Intellij 2021.1 HOT 1
- vue-gwt admin project demo HOT 1
- Integration tests break on Windows because of line breaks HOT 1
- Add static import support in templates
- Add SASS/SCSS support for scoped styles.
- Works with Gradle instead of Maven? HOT 13
- Improve with a more explicit error in the case of absence of jsinterop exports
- Cannot compile war file from IntelliJ HOT 5
- Implicit boolean value in HTML template HOT 2
- CSS Speudo class problem
- Support .sync Modifier HOT 1
- cannot integrate with compilation problems HOT 1
- how to run βYour First Component # Simple Link Componentβ HOT 1
- Catch events from JS in Java HOT 8
- Replace Nashorn HOT 7
- Is it possible to parse a .vue file using this project HOT 1
- vue-next support HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-gwt.