如题。查了下url的resolve方法。看到了个例子。
url.resolve('/one/two/three', 'four') // '/one/two/four'
url.resolve('http://example.com/', '/one') // 'http://example.com/one'
url.resolve('http://example.com/one', '/two') // 'http://example.com/two'
这三个结果无法理解。有人帮忙解释下吗
回复 (2)
T
拼接,容错
F
文档么不看仔细:
The url.resolve() method resolves a target URL relative to a base URL in a manner similar to that of a Web browser resolving an anchor tag HREF.
和浏览器里的 a标签行为一致
参与回复
登录后即可参与回复。登录