Read Text Input
Receive input events with bindinput and write event.detail.value back to page data. The template updates after setData().
Complete the Example
Receive input events with bindinput and write event.detail.value back to page data. The template updates after setData().
<script setup>
export default {
data: { name: '' },
handleInput(event) {
this.setData({ name: event.detail.value });
}
};
</script>
<page>
<input placeholder="Enter a name" bindinput="handleInput" />
<text>Hello, {{ name || 'developer' }}</text>
</page>
Keep input handlers lightweight and run expensive work from an explicit confirmation action.