实现如下:
<template>
<el-card>
<el-input :model-value="state.name" @update:modelValue="valueChange" class="w-340"/>
</el-card>
</template>
<script lang="ts" setup>
import {state, setName} from '../store'
const valueChange = val =>{setName(val)
}
</script>