dabernathy89 / vue-query-builder

A UI component for building complex queries with nested conditionals.
https://dabernathy89.github.io/vue-query-builder/
MIT License
643 stars 157 forks source link

Cannot catch update:query event emit #42

Closed booni3 closed 5 years ago

booni3 commented 5 years ago

This is probably more to do with incorrect syntax/code on my side, but I cannot catch the emit event from the component.

Usually I would just do:

<my-component @emit_event="function"></my-component>

To catch the emitted event, but when I update the query and try to catch with @update:query nothing happens.

<vue-query-builder :rules="rules" :initial-query="initialQuery" @update:query="updateQuery"></vue-query-builder>

Instead I am using v-model on the query builder, which is actually working but I think the intention is to be using the event?

This may be more of a stack overflow issue, but hopefully you are able to help!

dabernathy89 commented 5 years ago

Hey @booni3 - this is a sorta recent change; you should use v-model. Let me know if you run into any trouble!

https://github.com/dabernathy89/vue-query-builder/releases/tag/v0.6.0

booni3 commented 5 years ago

@dabernathy89 thanks for the quick reply! I was actually using v-model before but then saw the emit event in your code and that it was being used in your example laravel package. Thank you for cleaning this up though - thought I was going mad not being able to catch the update event!

dabernathy89 commented 5 years ago

@booni3 I probably forgot to update some of the example code. Can you point me to where that is?

booni3 commented 5 years ago

@dabernathy89 sure - its found here:

https://github.com/dabernathy89/vue-query-builder-laravel-example/blob/master/resources/views/home.blade.php

The rest of the example worked correctly once this was updated.