Comments (4)
Hello! It looks like you're trying to use the function before the component is mounted:
form.value?.setErrors(/* ... */); // This will be undefined since the component is not mounted
onMounted(() => {
form.value.setErrors(/* ... */); // This will be defined
});
See: https://vuejs.org/guide/essentials/template-refs.html#accessing-the-refs
from ui.
The onSubmit function is called after the component is mounted
from ui.
Can you send me a reproduction using Stackblitz so I can have a look? I can't reproduce the issue from the documentation's example
from ui.
hi, I run in the same problem. do your response have a path? My solution was to set it manually
const swwError = ref(false); //somethingWentWrongError
const form = ref();
const onSubmit = async (event) => {
try {
const data = await authStore.create(event.data);
router.push("/");
} catch (error) {
//email exists already
if (error.response.status === 422) {
form.value.setErrors([
{
message: error.response.data.message,
path: "email",
},
]);
} else {
// For all other errors, a standard error message is displayed at the top of the form
swwError.value = true;
}
}
```
from ui.
Related Issues (20)
- Are all the components built during build process ?
- is there no INTELLISENSE / AUTO COMPLETE for typing? HOT 3
- Notification position HOT 2
- [Pagination] emits on buttons? HOT 1
- Semi-Collapsible UDashboardPanel in Dashboard Template HOT 2
- `UDropdown` max height HOT 1
- the `icon` component that integrated in `nuxt-ui` by default is not cached HOT 2
- Docs: variant is not dropdown anymore HOT 1
- Missing tailwind classes for dynamic colors HOT 5
- when using the UCommandPalette I click on one item and all get selected HOT 1
- How to render a component in a UModal? HOT 2
- DatePicker undefined 'dayIndex' error for custom date selection (docs out of date?) HOT 6
- vscode tailwind css intellisense not working HOT 3
- Allow the "UAvatar" component to accept a background color. HOT 2
- Modal enter transition not working HOT 1
- Issue Nuxt UI Pro UDashboardModal background
- Custom variants not recognized by TypeScript in app.config.ts after updating to v2.18.0
- UTable select column pushing other columns to right when only few columns selected
- useFormGroup Cannot read properties of undefined (reading 'legend') HOT 1
- UTable - hide the "select all" checbox in header HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ui.