日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

ace admin ajax加载页面,循环加载首页的解决办法

發布時間:2023/12/20 编程问答 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ace admin ajax加载页面,循环加载首页的解决办法 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

ace admin 1.4

?

出現循環加載,主要是因為找不到頁面,

??

需要ajax加載的div

<div class="page-content-area" data-ajax-content="true"><!-- ajax content goes here --> </div>

?

修改ace-1.4.0\assets\js\src\ace.basics.js

var demo_ajax_options = {'close_active': true,close_mobile_menu: '#sidebar',close_dropdowns: true,'default_url': 'page/index',//default hash'content_url': function(hash) {//***NOTE***//this is for Ace demo only, you should change it to return a valid URL//please refer to documentation for more infoif( !hash.match(/^page\//) ) return false;var path = document.location.pathname;//for example in Ace HTML demo version we convert /ajax/index.html#page/gallery to > /ajax/content/gallery.html and load itif(path.match(/(\/ajax\/)(index\.html)?/))return path.replace(/(\/ajax\/)(index\.html)?/, '/ajax/content/'+hash.replace(/^page\//, '')+'.html') ;//for example in Ace PHP demo version we convert "ajax.php#page/dashboard" to "ajax.php?page=dashboard" and load itreturn path + "?" + hash.replace(/\//, "=");} }

?修改為自己的邏輯

'default_url': '/welcome',

return contextPath + hash; (contextPath是預置的)

var demo_ajax_options = {'close_active': true,close_mobile_menu: '#sidebar',close_dropdowns: true,// 'default_url': 'page/index',//default hash'default_url': '/welcome',//default hash'content_url': function(hash) { // //***NOTE*** // //this is for Ace demo only, you should change it to return a valid URL // //please refer to documentation for more info // // if( !hash.match(/^page\//) ) return false; // var path = document.location.pathname; // // //for example in Ace HTML demo version we convert /ajax/index.html#page/gallery to > /ajax/content/gallery.html and load it // if(path.match(/(\/ajax\/)(index\.html)?/)) // return path.replace(/(\/ajax\/)(index\.html)?/, '/ajax/content/'+hash.replace(/^page\//, '')+'.html') ; // // //for example in Ace PHP demo version we convert "ajax.php#page/dashboard" to "ajax.php?page=dashboard" and load it // return path + "?" + hash.replace(/\//, "=");if(hash==""){if(window.Pace && Pace.running) Pace.stop();$(this).ace_ajax('stopLoading', true);}return contextPath + hash;} }

?

菜單欄說明

<a data-url="/welcome" href="#/welcome"><i class="menu-icon fa fa-tachometer"></i><span class="menu-text"> Dashboard </span> </a>

href是鏈接

data-url 當前頁面地址與之對應時高亮選中

?

參考:

Ace Admin 使用教程

https://www.cnblogs.com/LeeScofiled/p/6733625.html

總結

以上是生活随笔為你收集整理的ace admin ajax加载页面,循环加载首页的解决办法的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。