Answer the question
In order to leave comments, you need to log in
How to connect vuelidate via cdn?
connected like this, but it doesn't work
index.html?name=&email=&tel=&lenguage=:39 Uncaught TypeError: Cannot destructure property 'required' of 'window.validators' as it is undefined.
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
<script src="https://bundle.run/[email protected]"></script>
<script>
const { required, minLength } = window.validators; /*:class="{invalid:($v.name.$dirty && !$v.name.required)}*/
new Vue({
el: "#app",
data: {
name: '',
email: '',
tel: '',
lenguages:['en','ru','ua'],
lenguage:""
},
validations: {
name: {
required,
minLength: minLength(5)
},
email: {
email,
required,
},
tel: {
required,
minLength: minLength(5)
},
},
methods: {
submitHandler() {
if(this.$v.$invalid){
this.$v.$tach();
}
}
}
})
</script>
поделючил так <script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/index.min.js"></script>
ошибка
index.js:3 Uncaught ReferenceError: exports is not defined
Uncaught ReferenceError: required is not defined
Answer the question
In order to leave comments, you need to log in
Judging by the dock , you need
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vuelidate.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/validators.min.js"></script>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question