How to use magix - 10 common examples

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 / tmpl / mx-btn / __test__ / 2.js View on Github external
let Magix = require('magix');
let Base = require('__test__/example');
let $ = require('$');
Magix.applyStyle('@index.less');
module.exports = Base.extend({
    tmpl: '@2.html',
    render() {
        this.updater.digest();
    }
});
github thx / magix-gallery / tmpl / mx-grid / __test__ / 3.js View on Github external
let Magix = require('magix');
let Base = require('__test__/example');
let $ = require('$');
Magix.applyStyle('@index.less');

module.exports = Base.extend({
    tmpl: '@3.html',
    render() {
        this.updater.digest();
    }
});
github thx / magix-gallery / tmpl / mx-grid / __test__ / 8.js View on Github external
let Magix = require('magix');
let Base = require('__test__/example');
let $ = require('$');
Magix.applyStyle('@index.less');

module.exports = Base.extend({
    tmpl: '@8.html',
    render() {
        this.updater.digest({
            icon: '<i class="mc-iconfont fontsize-20 bold"></i>',
            img: '<img src="//img.alicdn.com/tfs/TB1LtU5V5LaK1RjSZFxXXamPFXa-500-100.png">'
        });
    }
});
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 &lt; 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 &lt; 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 &lt; 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 &lt; 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) =&gt; {
    id = id || 'id';
    pId = pId || 'pId';
    let map = {},
        listMap = {},
        rootList = [];
    for (let i = 0, max = list.length; i &lt; 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) &amp;&amp; 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({
github thx / magix / project / src / coms / menu / context.js View on Github external
show: function(view, e) {
        var node = e.ownerNode;
        var id = node.id || (node.id = Magix.guid('ctx'));
        id = 'ctx_' + id;
        var vf = Magix.Vframe.get(id);
        if (vf) {
            vf.invoke('show', [e], true);
        } else {
            $('body').append('<div id="' + id + '">');
            vf = view.owner.mountVframe(id, 'coms/menu/context');
            vf.invoke('update', [e], true);
            vf.invoke('show', [e], true);
        }
    }
});
</div>
github thx / magix-gallery / tmpl / mx-table / attach.js View on Github external
'@{thead.sticky}'(table) {
        let id = table.attr('id');
        if (!id) {
            table.attr('id', id = Magix.guid('table_'));
        }
        table.find('thead').css({
            width: table.width()
        });
        this.owner.mountVframe(id, '@./isticky');
    },
    '@{sync.cell.height}'() {

magix

view manager framewrok

MIT
Latest version published 5 years ago

Package Health Score

42 / 100
Full package analysis