12 lines
181 B
JavaScript
12 lines
181 B
JavaScript
|
|
export const useSyncProps = (props, key, emit) => {
|
|
return computed({
|
|
get() {
|
|
return props[key]
|
|
},
|
|
set(value) {
|
|
emit(`update:${key}`, value)
|
|
}
|
|
})
|
|
}
|