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

Short word for @update:model-value #8177

Closed
abumalekFayed opened this issue Apr 28, 2023 · 5 comments
Closed

Short word for @update:model-value #8177

abumalekFayed opened this issue Apr 28, 2023 · 5 comments
Labels
✨ feature request New feature or request

Comments

@abumalekFayed
Copy link

What problem does this feature solve?

@update:model-value used many time and can be used instead of creating watch function so it will be pretty if their is short word instead of a long word.
some suggestions
1-$u (as $ can be used as short syntax for v-model so we can add u character to it to inform as update $)
2-@$
3-@::

What does the proposed API look like?

make syntax more clean with short code

@abumalekFayed abumalekFayed added the ✨ feature request New feature or request label Apr 28, 2023
@Shyam-Chen
Copy link
Contributor

@yyx990803
Copy link
Member

#8018

@abumalekFayed
Copy link
Author

abumalekFayed commented Apr 28, 2023

#8018

I mean short word for @update:model-Value not v-model

@Shyam-Chen
Copy link
Contributor

Shyam-Chen commented Apr 28, 2023

<script lang="ts" setup>
const modelValue = defineModel<string>({ default: '' });
</script>

<template>
  <input v-model="modelValue" />
</template>
<script lang="ts" setup>
import { ref } from 'vue';

import TextField from '~/components/TextField.vue';

const val = ref('');
</script>

<template>
  <TextField v-model="val" />
  {{ val }}
</template>

@abumalekFayed
Copy link
Author

<script lang="ts" setup>
const modelValue = defineModel<string>({ default: '' });
</script>

<template>
  <input v-model="modelValue" />
</template>
<script lang="ts" setup>
import { ref } from 'vue';

import TextField from '~/components/TextField.vue';

const val = ref('');
</script>

<template>
  <TextField v-model="val" />
  {{ val }}
</template>

Thank you but you have misconceptions about what i want. i will try describe in details
You know in vue 3.3 new macros was released from this macros short v-model syntax you can write $ or :: instead of v-model okay.
What i taking about is introduce short syntax also for update model event which triggered when model value changed to be
@$ or @:: instead of @update:model-value.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
✨ feature request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants