Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

The final function left to implement for vehicles crud is the delete button functionality in the index view which is very quick.

1. Extend Store

Extend vehicle store src/stores/vehicle.js...

The Full Lesson is Only for Premium Members

Want to access all of our courses? (29 h 14 min)

You also get:

54 courses
Premium tutorials
Access to repositories
Private Discord
Get Premium for $129/year or $29/month

Already a member? Login here

Comments & Discussion

KD
K.G. Dev ✓ Link copied!

Hi there. A suggestion to add a confirm dialog before deleting the vehicle.

I added the following basic functionalities in the src/views/Vehicles/IndexView.vue:

<script setup>
.....

const deleteVehicle = (vehicle) => {
        let deleteConfirmation = confirm("Are you sure you want to delete this vehicle?");
        
        if(deleteConfirmation){
            store.deleteVehicle(vehicle)
        }
}
</script>

and the delete button looks like

<button
     @click="deleteVehicle(vehicle)"
     type="button"
     class="btn text-white bg-red-600 hover:bg-red-500 text-sm"
>
    X
</button>
PK
Povilas Korop ✓ Link copied!

Great suggestion, thanks!

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.