Through the function to pass the value of the parameter, how to get this value when the operation specifies the object?

first look at the code, which is a function in vue:

    delChatConfirm(index) {
      this.$Modal.confirm({
        title: "",
        onOk: () => {
          delete this.$store.state.messages.index
          // indexindex
        }
      });
    },

I want to send the value of index passed above to the index of the line above. For example, when the value of index passed in 123 , the line of
delete operation looks like this:

delete this.$store.state.messages.123

is there any way to do this?

Aug.09,2021

delete this.$store.state.messages[index]
Menu