In our development environment for the Django project, we do not utilize npm. However, we incorporate VueJS in templates and have successfully integrated vee-validate. I am currently facing a challenge with overriding error messages without importing, which seems to be the only way I know how.
Attempting to create a new script type="module" did not yield the desired results:
Failed to resolve module specifier "vee-validate". Relative references must start with either "/", "./", or "../".
This is the code snippet I am struggling with:
<script src="https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b7c1d2d29ac1d6dbded3d6c3d2f785998799879ad5d2c3d6998582">[email protected]</a>"></script>
<script type="module">
import {localize} from 'vee-validate';
localize({
en: {
messages: {
required: 'xxxxxxxx',
min: 'this field must have no less than {length} characters',
max: (_, {length}) => `this field must have no more than ${length} characters`
}
}
});
</script>
If you have any suggestions on how to effectively override these messages, please share your ideas.