packages/okam-build/lib/processor/template/transform/quick/tpl.js
function findImportElement(node) {
    let parent = node.parent;
    if (!parent) {
        return;
    }

    let children = parent.children;
    let found;
    children.some(item => {
        if (item.type === 'tag' && item.name === 'import') {
            found = item;
            return true;
        }
        return false;
    });

    if (found) {
        return found;
    }

    return findImportElement(parent);
}
function findImportElement(node) {
    let parent = node.parent;
    if (!parent) {
        return;
    }

    let children = parent.children;
    let found;
    children.some(item => {
        if (item.type === 'tag' && item.name === 'import') {
            found = item;
            return true;
        }
        return false;
    });

    if (found) {
        return found;
    }

    return findImportElement(parent);
}
Find the import element
Notice: currently, it does not support multiple import elements in template.

@inner
@param {Object} node the element node to use the import template
@return {?Object}