I see the following code in vue github link
declare const RefSymbol: unique symbol
export declare const RawSymbol: unique symbol
export interface Ref<T = any> {
value: T
[RefSymbol]: true
}
what is RefSymbol mean here? i have tried this code:
let test:Ref={value:1}
vscode tell me that I am missing attributes of [RefSymbol]
i had read these questions:
some example code is
interface StringArray {
[index: number]: string;
}
let myArray: StringArray;
myArray = ["Bob", "Fred"];
let myStr: string = myArray[0];
which is quite different with the first example code , it use:true
rather than type :string
, and i did not know how to pass value to [RefSymbol] ,can anyone explain this thing? thanks for any reply