File tree Expand file tree Collapse file tree 4 files changed +31
-2
lines changed
main/java/com/axellience/vuegwt/processors/component/template/parser
java/com/axellience/vuegwt/processors/component/vmodel Expand file tree Collapse file tree 4 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -404,8 +404,13 @@ private void processVModel(Attribute vModelAttribute) {
404404 String vModelValue = vModelAttribute .getValue ();
405405 VariableInfo vModelDataField = context .findRootVariable (vModelValue );
406406 if (vModelDataField == null ) {
407- logger .error ("Couldn't find @Data or @Computed for v-model \" " + vModelValue
408- + "\" . V-Model is only supported on @Data and @Computed." );
407+ if (vModelValue .contains ("." )) {
408+ logger .error ("v-model doesn't support dot notation in Vue GWT: \" " + vModelValue
409+ + "\" . Try using a @Computed with a getter and a setter. Check our documentation on v-model for more information." );
410+ } else {
411+ logger .error ("Couldn't find @Data or @Computed for v-model \" " + vModelValue
412+ + "\" . V-Model is only supported on @Data and @Computed. Check our documentation on v-model for more information." );
413+ }
409414 return ;
410415 }
411416
Original file line number Diff line number Diff line change @@ -23,4 +23,17 @@ void vmodelWithInvalidField() {
2323 assertThat (compilation ).hadErrorContaining (
2424 "Couldn't find @Data or @Computed for v-model \" nonExistingField\" " );
2525 }
26+
27+ @ Test
28+ @ DisplayName ("should throw an error when using a v-model with dot notation" )
29+ void vmodelWithDotNotation () {
30+ Compilation compilation =
31+ javac ()
32+ .withProcessors (new VueGwtProcessor ())
33+ .compile (
34+ JavaFileObjects .forResource ("vmodel/VModelDotNotationComponent.java" ));
35+
36+ assertThat (compilation ).hadErrorContaining (
37+ "v-model doesn't support dot notation in Vue GWT: \" dot.notation\" " );
38+ }
2639}
Original file line number Diff line number Diff line change 1+ < div >
2+ < input type ="text " v-model ="dot.notation ">
3+ </ div >
Original file line number Diff line number Diff line change 1+ package vmodel ;
2+
3+ import com .axellience .vuegwt .core .annotations .component .Component ;
4+ import com .axellience .vuegwt .core .client .component .IsVueComponent ;
5+
6+ @ Component
7+ public class VModelDotNotationComponent implements IsVueComponent {
8+ }
You can’t perform that action at this time.
0 commit comments