I am trying to create a simple form with a search bar and two buttons. The goal is for the fill button to be visible only when there is text in the input, and for the empty button to show when the input is empty. I want the buttons to dynamically display or hide based on the content of the input field, updating instantly with any changes. How can this functionality be achieved using Vue.js?
The desired behavior is for the fill button to appear when the input has text. When clicked, it should clear the input, hiding itself and revealing the empty button. The fill button's purpose is to reset the input when it contains text.
<form class="myform">
<button type="reset" class="fill">Show when fill </button>
<button class="empty">Show when empty</button>
<input type="search" class="myinput">
</form>