Git Product home page Git Product logo

Comments (7)

slavap avatar slavap commented on May 30, 2024 1

@adrienbaron Thanks! Will try it in the morning.

from vue-gwt.

adrienbaron avatar adrienbaron commented on May 30, 2024

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.

slavap avatar slavap commented on May 30, 2024

@adrienbaron Strange, but I have components = { BoilingVerdict.class, TemperatureInput.class ) in my code, and have to register all components manually anyway.

from vue-gwt.

adrienbaron avatar adrienbaron commented on May 30, 2024

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.

slavap avatar slavap commented on May 30, 2024

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

slavap avatar slavap commented on May 30, 2024

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

adrienbaron avatar adrienbaron commented on May 30, 2024

Great! Thanks for the details 😊! Closing the issue πŸ˜‰

from vue-gwt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.