History cannot be deleted, this is a browser thing.
You can use the $stateChangeStart event to control it. Refer to $stateChangeStart in this document to write it. The general idea is to use some method to retain whether add is saved. Then if the current route is group, the route to go to when clicking return is add. Then if the add is saved, prevent this event and go to the list. If it is not saved, jump normally
Or use a little trick, use window.history.go(-1) when clicking save, don’t use $state.go to jump
History cannot be deleted, this is a browser thing.
You can use the $stateChangeStart event to control it. Refer to $stateChangeStart in this document to write it. The general idea is to use some method to retain whether add is saved. Then if the current route is group, the route to go to when clicking return is add. Then if the add is saved, prevent this event and go to the list. If it is not saved, jump normally
Or use a little trick, use window.history.go(-1) when clicking save, don’t use $state.go to jump