docs icon indicating copy to clipboard operation
docs copied to clipboard

Clarify the cases using number, bigint or symbol as key

Open LongTengDao opened this issue 5 years ago • 2 comments

Vue 2 doc had add symbol for key api in version 2.5.12

In Vue 3 doc, key is still number | string.

  1. Is symbol deprecated? Or just not implement yet?
  2. Will bigint be supported?
  3. Is 1 treated as same key to "1"? Whether is or not, is it intended?

LongTengDao avatar Nov 17 '20 15:11 LongTengDao

I've opened an issue against the main repo to get clarification about what the expected behaviour is:

https://github.com/vuejs/vue-next/issues/2633

I believe the TS definitions currently only allow number | string but, in my opinion, that's overly restrictive. If the TS definitions are updated then the docs can follow.

skirtles-code avatar Nov 18 '20 15:11 skirtles-code

I'm not sure that's a bug or feature, so I didn't ask in vue-next. I even have no idea it belong to Vue 2 / 3 / 2&3...

Problem more than restrictive is that, if support all these types, they will be use as it is, or stringify any type (except symbol) to string firstly?

I can study the soure, but I'm not sure that's intended and stable.

LongTengDao avatar Nov 19 '20 12:11 LongTengDao