m2-mobui
Version:
The package is provided web components and utilities based on vue and element-ui.
28 lines (24 loc) • 678 B
JavaScript
;
exports.__esModule = true;
var _m2Core = require('m2-core');
var _main = require('../utils/main');
exports.default = {
methods: {
handleLinkClick: function handleLinkClick(item) {
if (item.url) {
if ((0, _main.isRouteLink)(item.url) && this.$router) {
try {
var link = this.$router.push({ path: item.url });
if (link && link.catch) {
link.catch(function () {});
}
} catch (e) {}
} else {
window.open(item.url, item.target || '_blank');
}
} else if (_m2Core.DataType.isFunction(item.click)) {
item.click(item);
}
}
}
};