我试图让 Vue Formulate 运行,但它不起作用。这是我的代码:
此版本包括导入语句: https ://vueformulate.com/guide/installation/#direct-download
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@braid/vue-formulate@2.4.1/dist/formulate.umd.min.js"></script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es2015"></script>
<template>
<FormulateForm
v-model="values"
:schema="schema"
/>
</template>
<script>
import Vue from 'vue'
import VueFormulate from '@braid/vue-formulate'
Vue.use(VueFormulate)
export default {
data () {
return {
values: {},
schema: [
{
type: 'password',
name: 'password',
label: 'Enter a new password',
validation: 'required'
},
{
type: 'password',
name: 'password_confirm',
label: 'Confirm your password',
validation: '^required|confirm:password',
validationName: 'Password confirmation'
},
{
type: 'submit',
label: 'Change password'
}
]
}
}
}
</script>
打开站点会导致控制台中出现以下错误:
formulate.umd.min.js:5 Uncaught TypeError: Cannot read property 'en' of undefined
at new Jt (formulate.umd.min.js:5)
at formulate.umd.min.js:5
at formulate.umd.min.js:5
at formulate.umd.min.js:5
Jt @ formulate.umd.min.js:5
(anonymous) @ formulate.umd.min.js:5
(anonymous) @ formulate.umd.min.js:5
(anonymous) @ formulate.umd.min.js:5
test.html:15 Uncaught SyntaxError: Unexpected token 'export'
谢谢!