# useModelValue/useModelDeepValue

获取一个可`set`/`get`的`computed value`。

使用`useModelValue`可以获得第一层数据，并自动捕获数据类型，无需泛型修正    
使用`useModelDeepValue`可以获得深层数据，但需泛型修正具体类型    

``` vue
<template>
    <el-input v-model="myDataPropA"></el-input>
    <el-input v-model="myDataPropB"></el-input>
    <el-date-picker
        v-model="myDataPropC"
        type="daterange"
        range-separator="至"
        format="YYYY-MM-DD"
        start-placeholder="开始日期"
        end-placeholder="结束日期"
    />
</template>

<script lang="ts" setup>
import { defineProps } from "vue";
import { useModelValue, useModelDeepValue } from ".";

const props = defineProps({
    modelValue: {
        type: Object,
        default: () => ({})
    }
})
const myDataPropA = useModelValue(() => props.modelValue, 'propA');
const myDataPropB = useModelDeepValue(() => props.modelValue, 'propB.name');
const myDataPropC = useModelDeepValue<string[]>(() => props.modelValue, 'propB.deepProp.list');
</script>
```
### Demo


沧海一声笑🤣🤣🤣    
喵喵喵喵喵🐶🐶🐶

