Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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();
}
});
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();
}
});
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">'
});
}
});
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) {
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) {
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) {
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) {
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({
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>
'@{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}'() {