vuetifyjs / vuetify

🐉 Vue Component Framework
https://vuetifyjs.com
MIT License
39.12k stars 6.92k forks source link

[Feature Request] VConfirmEdit - expose dirty/pristine status #19747

Closed daniser closed 5 days ago

daniser commented 2 weeks ago

Problem to solve

Ability to check if underlying model have changed or not. For example, to hide action buttons:

<template>
  <v-confirm-edit v-model="model">
    <template #default="{ model: proxyModel, actions, isPristine }">
      <v-card>
        <v-card-text>
          <v-text-field v-model="proxyModel.value" />
        </v-card-text>
        <v-card-actions>
          <component v-if="!isPristine" :is="actions" />
        </v-card-actions>
      </v-card>
    </template>
  </v-confirm-edit>
</template>

Proposed solution

Expose isPristine variable from component.