You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
461 B
20 lines
461 B
import { Ref, ref, watch, unref } from 'vue';
|
|
import { BasicTableProps } from '../types/table';
|
|
|
|
/**
|
|
* @description:
|
|
* @Date: 2020-05-12 13:20:37
|
|
*/
|
|
export function useProps(props: Readonly<Ref<BasicTableProps>>) {
|
|
const propsRef = (ref<BasicTableProps>(unref(props)) as unknown) as Ref<BasicTableProps>;
|
|
watch(
|
|
() => props.value,
|
|
(v) => {
|
|
propsRef.value = unref(v);
|
|
},
|
|
{
|
|
immediate: false,
|
|
}
|
|
);
|
|
return { propsRef };
|
|
}
|
|
|