This params2 got "version". Why did you put the double quotation marks?

can"t you write this way to get the dynamic key value?

        let params= this.search.content;

        let params2= this.search.type;

        try {
      
          let ret = await this.$Api.Sysconf.ExPro.Query (
            {
              pageSize: this.pageSize,
              pageNumber:page,
              params2:params
            })

this params2 gets "version". How to remove the double quotation marks

Feb.25,2022

if it is a string, directly Number (params)


let data = {
    version:'v1.0.5'
}
let version = data[params2];

I don't know if that's what you mean. You can take the value directly through obj [prop]

when saving as an object.

if dynamic is used as a key value, you can use it like this:

[params2]: params

you can directly use replaceAll () to match out double quotes

Menu