3.7 删除数据

IDBObjectStore.delete()方法用于删除记录。

  1. function remove() {
  2. var request = db.transaction(['person'], 'readwrite')
  3. .objectStore('person')
  4. .delete(1);
  5. request.onsuccess = function (event) {
  6. console.log('数据删除成功');
  7. };
  8. }
  9. remove();