如何像这个例子那样用 TikZ 链连接节点?

How to connect nodes with TikZ chain like this example?

看完How to connect nodes with TikZ?,我在思考如何将下面的简单示例转换为使用TiKz链。

当前 MWE:

\documentclass[tikz]{standalone}
\usetikzlibrary{arrows,positioning,calc}

\tikzset{
    block/.style={draw,text width=2em,minimum height=1em,align=center},
    arrow/.style={->}
}
\newcommand\connect[2]{\path[draw,arrow] (#1) |- ($(#1)!1/2!(#2)$) -| (#2)}

\begin{document}
\begin{tikzpicture}[>=stealth']
    \node[block] (N1) {N1};
    \node[block,below=1cm of N1,xshift=-1cm] (N2) {N2};
    \connect{N1}{N2};
\end{tikzpicture}
\end{document}

当前输出:

我想用chain library来做,但还是没有找到正确的方法。节点位置不要改变,连接线样式要保持一致。

来自this的例子,它使用链条进行直线节点连接,但使用\draw命令绘制非直线路径。

所以我觉得现在的任务用chain是不合适的。或者你可以只创建两个不可见的坐标然后用链连接它(太复杂了吧?)。

\documentclass[tikz]{standalone}
\usetikzlibrary{arrows,chains,positioning,scopes,quotes}

\tikzset{
    block/.style={draw,text width=2em,minimum height=1em,align=center},
    arrow/.style={->}
}

\begin{document}
    \begin{tikzpicture}[>=stealth']
    {[start chain]
        \node[block,on chain] (N1) {N1};
        \node[block,on chain,join=by {arrow},below=1cm of N1,xshift=-1cm] (N2) {N2};
    }
    \end{tikzpicture}
\end{document}