找到解决方案here.
只需添加以下js代码:
var makeTabs = function(selector) {
$( selector )
.find( "ul a" ).each( function() {
var href = $( this ).attr( "href" ),
newHref = window.location.protocol + \'//\' + window.location.hostname +
window.location.pathname + href;
if ( href.indexOf( "#" ) == 0 ) {
$( this ).attr( "href", newHref );
}
})
$( selector ).tabs();
};
makeTabs( "#tabs" );