toRef: tạo ref từ một property của reactive object — giữ reactive connection:
javascript
const state = reactive({ count: 0, name: 'Vue' })
const countRef = toRef(state, 'count') // linked to state.counttoRefs: convert toàn bộ reactive object thành object of refs — dùng khi destructure:
javascript
const { count, name } = toRefs(state)toValue (Vue 3.3+): unwrap ref hoặc getter — dùng trong composables để accept cả ref và plain value:
javascript
function useFeature(id: MaybeRefOrGetter<string>) {
const resolvedId = toValue(id) // unwrap nếu là ref
}