钚组件
本单元包含form.io的溢价组件.
使用量
import premium from '@formio/premium';
import { Formio } from '@formio/js';
// You need to have a valid Library License key to use this package.
// If you don't have one yet, please contact [email protected].
Formio.license = 'yourLibraryLicenseKey';
Formio.use(premium);
如果你想使用一个 <script> 直接在 HTML 文件内标记* :
<script src="node_modules/@formio/premium/premium.full.min.js"></script>
*这也暴露了变量 premium,允许您加载模块 Formio.use(premium);
您还需要包含来自 '/node modules/@formio/premium/premium.css' (法语) 进入您的项目,以使所有组件正常工作.
使用 HTML
<link rel="stylesheet" type="text/css" href="node_modules/@formio/premium/premium.css" />
使用常设委员会
@import '~@formio/premium/premium.css';
解决问题
以防万一你还用 webpack 以捆绑您的应用程序并满足错误 "Can't resolve 'Formio' in 'node_modules/@formio/premium'" 请在建设时添加以下内容: webpack 配置 :
resolve: {
alias: {
Formio: require('node:path').resolve(__dirname, 'RELATIVE_PATH_TO_YOUR_APP_NODE_MODULES_DIR/formiojs/index.js'),
},
}