diff options
| author | BigCoke233 <hi@guhub.cn> | 2020-04-01 09:48:09 +0800 |
|---|---|---|
| committer | BigCoke233 <hi@guhub.cn> | 2020-04-01 09:48:09 +0800 |
| commit | 8c8810f08322c722ff4e319bfcabca93ef92cc86 (patch) | |
| tree | 5d699a4e4ab8661b6798c733f0d5bb29590a1b59 /libs/Contents.php | |
| parent | 756f041fdc94f0966ef6759d5905bc88052ed7b7 (diff) | |
:bulb: Fix: 移动端和抽屉栏导航无法正常使用
Diffstat (limited to 'libs/Contents.php')
| -rw-r--r-- | libs/Contents.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libs/Contents.php b/libs/Contents.php index 37b2555..db9bfff 100644 --- a/libs/Contents.php +++ b/libs/Contents.php @@ -135,14 +135,22 @@ class Contents /** * 解析自定义导航栏 */ - static public function paresNav($data) { + static public function paresNav($data, $type) { $de_json = json_decode($data, true); $count_json = count($de_json); for ($i = 0; $i < $count_json; $i++) { $title = $de_json[$i]['title']; $link = $de_json[$i]['link']; //输出导航 - echo '<a href="'. $link .'">'. $title .'</a>'; + if($type="top-nav") { + echo '<a href="'. $link .'">'. $title .'</a>'; + } + elseif($type="mobile") { + echo '<div class="col-6"><a href="'. $link .'">'. $title .'</a></div>'; + } + elseif($type="drawer") { + echo '<a href="'. $link .'" onclick="toggleDrawer()">'. $title .'</a>'; + } } } |
