How to use the magix.has function in magix

To help you get started, we’ve selected a few magix examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github thx / magix-gallery / build / src / mx-form / index.js View on Github external
fromKeys: function (data, keys) {
        keys = (keys + '').split(',');
        var r = {};
        for (var i = 0, key = void 0; i < keys.length; i++) {
            key = keys[i];
            r[key] = Magix.has(data, key) ? data[key] : '';
        }
        return r;
    },
    '$[mxc]': function (e) {
github thx / magix-gallery / build / src / mx-form / index.js View on Github external
fromKeys: function (data, keys) {
        keys = (keys + '').split(',');
        var r = {};
        for (var i = 0, key = void 0; i < keys.length; i++) {
            key = keys[i];
            r[key] = Magix.has(data, key) ? data[key] : '';
        }
        return r;
    },
    '$[mxc]': function (e) {
github thx / magix-gallery / tmpl / mx-form / index.js View on Github external
fromKeys(data, keys) {
        keys = (keys + '').split(',');
        let r = {};
        for (let i = 0, key; i < keys.length; i++) {
            key = keys[i];
            r[key] = Magix.has(data, key) ? data[key] : '';
        }
        return r;
    },
    '$[mxc]'(e) {
github thx / magix-project / tmpl / app / mixins / form.js View on Github external
getDataByKeys(data, keys) {
        keys = (keys + '').split(',');
        var r = {};
        for (var i = 0, key; i < keys.length; i++) {
            key = keys[i];
            r[key] = Magix.has(data, key) ? data[key] : '';
        }
        return r;
    },
    'syncValue' (e) {
github thx / magix-gallery / tmpl / mx-linkage / index.js View on Github external
let ListToTree = (list, id, pId) => {
    id = id || 'id';
    pId = pId || 'pId';
    let map = {},
        listMap = {},
        rootList = [];
    for (let i = 0, max = list.length; i < max; i++) {
        let one = Magix.mix({}, list[i]);
        map[one[id]] = one;
        if (listMap[one[id]]) {
            one.children = listMap[one[id]];
        }
        if (Magix.has(one, pId) && one[pId] !== '') {
            if (map[one[pId]]) {
                let c = map[one[pId]].children || (map[one[pId]].children = []);
                c.push(one);
            } else {
                if (!listMap[one[pId]]) listMap[one[pId]] = [one];
                else listMap[one[pId]].push(one);
            }
        } else {
            rootList.push(one);
        }
    }
    return { list: rootList, map };
};
module.exports = Magix.View.extend({

magix

view manager framewrok

MIT
Latest version published 5 years ago

Package Health Score

45 / 100
Full package analysis