问题标签 [canjs-plugin]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
558 浏览

javascript - Canjs 中的验证

如何实现 Canjs 的验证?我遇到了一些麻烦。在他们的指南页面上,他们这样做:

但是当我尝试这个时,我没有任何成功。

0 投票
1 回答
109 浏览

canjs - 如何包含/导入canjs的can.Object,以便可以使用can.Object.same?

我无法在 canjs 网站上制作以下示例:http: //canjs.com/docs/can.Object.same.html#section_Examples

浏览器中加载的以下页面将出现错误:'Uncaught TypeError: Cannot read property 'same' of undefined'

而且我还尝试使用requirejs来使用canjs:

但它是同一件事,can.Object 仍然是“未定义”。我想使用 can.Object.same 因为要检查两个对象在值级别是否相等。我没有使用underscorejs,否则我可以使用_.isEqual。

====除了Sebastian的回答,如果使用requirejs,在require([...])的列表中添加“can/util/object”。====