my.removeStorage

Remove cached data.

Supported types of mini programs: DSL, H5+

This is an asynchronous interface.

Removing the webview embedded storage data will not remove the storage data of the Mini Program.

Sample Code

copy
my.removeStorage({
  key: 'currentCity',
  success: function(){
    my.alert({content: 'remove success'});
  }
});

Parameters

PropertyType

Required

Description
keyStringYesCache data key.
successFunctionNoCallback function upon call success.
failFunctionNoCallback function upon call failure.
completeFunctionNoCallback function upon call completion (to be executed upon either call success or failure).

Error code

Error code

Error message

Further action

2

Required parameter is empty

Make sure the data type of the key parameter is correct and the value is not empty.