1

通过更新到最新版本,我一直在使用 jquery 输入掩码

最近作者发布了最新的3.60版本,就是amd

(function (factory) {
    if (typeof define === 'function' && define.amd) {
        define("jquery.inputmask", ['jquery'], factory);
    } else {
        factory(jQuery);
    }
}(function ($) {
    if ($.fn.inputmask === undefined) {

当我在要求定义中包含定义的路径时,它会抛出错误

jquery.inputmask 未定义。如果有人用过最新版本,知道怎么使用bundle amd文件,请帮忙

github原始文件网址 https://rawgit.com/RobinHerbots/jquery.inputmask/3.x/dist/jquery.inputmask.bundle.min.js

谢谢

4

1 回答 1

0

https://github.com/RobinHerbots/jquery.inputmask#usage

看看这个部分。

<script src="jquery.js" type="text/javascript"></script>
<script src="inputmask.js" type="text/javascript"></script>
<script src="jquery.inputmask.js" type="text/javascript"></script>

and add this to re

paths: {
  ...
  "dependencyLib": "../dist/inputmask/dependencyLib",
  "inputmask": "../dist/inputmask/inputmask",
  ...
}

for mee this looks like this

paths: {
	inputmask				  : 'jquery.inputmask/dist/inputmask/inputmask',
	dependencyLib             : 'jquery.inputmask/dist/inputmask//dependencyLib',
	jQueryInputmask			  : 'jquery.inputmask/dist/inputmask/jquery.inputmask',
}

于 2015-09-17T12:21:37.703 回答