my.setStorageSync

Store synchronously the data in the specified key in the local cache.

This is a synchronous interface.

Sample Code

copy
my.setStorageSync({
  key: 'currentCity',
  data: {
    cityName: 'London',
    adCode: '330100',
    spell: ' London',
  }
});

Parameters

NameTypeMandatoryDescription
keyStringYesCache data key
dataObject/StringYesData to be cached