mirror of https://github.com/vuejs/core.git
chore: minor tweaks
This commit is contained in:
parent
8420ff32dd
commit
5b53f8e209
|
@ -12,8 +12,11 @@ export function useTemplateRef<T = unknown, Keys extends string = string>(
|
||||||
const r = shallowRef(null)
|
const r = shallowRef(null)
|
||||||
if (i) {
|
if (i) {
|
||||||
const refs = i.refs === EMPTY_OBJ ? (i.refs = {}) : i.refs
|
const refs = i.refs === EMPTY_OBJ ? (i.refs = {}) : i.refs
|
||||||
const desc = Object.getOwnPropertyDescriptor(refs, key)
|
let desc: PropertyDescriptor | undefined
|
||||||
if (desc && !desc.configurable) {
|
if (
|
||||||
|
(desc = Object.getOwnPropertyDescriptor(refs, key)) &&
|
||||||
|
!desc.configurable
|
||||||
|
) {
|
||||||
if (__DEV__) {
|
if (__DEV__) {
|
||||||
warn(`useTemplateRef('${key}') already exists.`)
|
warn(`useTemplateRef('${key}') already exists.`)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue