Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add v-confirm-directive #19786

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

feat: add v-confirm-directive #19786

wants to merge 6 commits into from

Conversation

kieuminhcanh
Copy link
Member

@kieuminhcanh kieuminhcanh commented May 8, 2024

Confirm

<template>
  <v-app>
    <div class="ma-4 pa-4">
      <VBtn
        prepend-icon="mdi-delete-outline"
        text="Delete"
        v-confirm="{
          text: `Are you sure?`,
          onSubmit: () => console.log(`Record has been deleted`),
          onCancel: () => console.log('Canceled'),
        }"
      />
    </div>
  </v-app>
</template>

<script setup>
  import { ref } from 'vue'
</script>

Confirm with input

<VBtn text="Change Username" 
    v-confirm="{ text: `Enter new name`, input, onSubmit}"/>

const input = ref('')

@johnleider johnleider added T: feature A new feature C: New Component This issue would need a new component to be developed. D: New Directive A new directive labels May 9, 2024
) : (
<VTextField
v-model={ input.value }
variant="solo-filled"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add/allow text-field props to VConfirm? So it's not hardcoded

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, it has inputProps, but label is partially outside

Screenshot 2024-05-10 at 4 22 55 pm

@MajesticPotatoe MajesticPotatoe changed the title Add v-confirm-directive feat: add v-confirm-directive May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: New Component This issue would need a new component to be developed. D: New Directive A new directive T: feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants