menuMDUIDocs
color_lens
The new mdui 2 based on Material Design 3 and Web Components is now available. Check out the mdui 2 documentation.

Migrating from 0.4.3 to 1.0.0

mdui.$ update

In 0.4.3 it was called mdui.JQ, and in 1.0.0 it was renamed to mdui.$.

After this change, in an ES6 modular environment, you can import mdui.$ using the following method, which is more convenient to use.

import { $ } from 'mdui';

The capabilities of several methods in mdui.$ have also been expanded, which will not be detailed here. Only updates incompatible with 0.4.3 are listed below.

.width(), .height(), .innerWidth(), .innerHeight() changes

In 0.4.3, whether padding was included depended on the value of the box-sizing property.

In 1.0.0, the width and height are independent of the box-sizing property. This change ensures consistency with jQuery.

.offset(), .position() changes

In 0.4.3, the return value format was { top: number, left: number, width: number, height: number }.

In 1.0.0, the return value format was changed to { top: number, left: number }. This change ensures consistency with jQuery.

.children(), .parent(), .parents(), .prev(), .prevAll(), .next(), .nextAll(), .siblings() changes

In 0.4.3, the parameters could be CSS selectors, DOM elements, arrays, and other types.

In 1.0.0, the parameters can only be of the CSS selector type. This change ensures consistency with jQuery.

.has() changes

In 0.4.3, the parameters could be CSS selectors, DOM elements, arrays, and other types.

In 1.0.0, the parameters can only be CSS selectors or DOM elements. This change ensures consistency with jQuery.

.ready() removal

In 0.4.3, you could use $(document).ready(function () {}) to call a function executed once the DOM has finished loading.

In 1.0.0, please replace it with $(function () {}).

.ajax() changes

In 0.4.3, the return value of the .ajax() method was an XMLHttpRequest object. It also supported sending jsonp requests.

In 1.0.0, the return value was changed to a Promise. This method no longer supports jsonp requests.