乐趣区

关于前端:Vue3-中采用-updatemodelValue-手动更新数据

实现如下:

<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>
退出移动版