不显示“ion

编程入门 行业动态 更新时间:2024-10-06 10:37:56
本文介绍了不显示“ion-tab"在页面详细信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我有一个问题,我有一个代码,我显示了一个项目,它引导我进入一个页面,其中显示了每个项目的详细信息,但该页面没有向我显示"ion -tab "

任何帮助

谢谢

附件代码:

路由器:

.config(function($stateProvider, $urlRouterProvider, $ionicConfigProvider){$ionicConfigProvider.navBar.alignTitle("center");$stateProvider.state(应用程序",{templateUrl: "templates/app.html",网址:/应用",摘要:真实}).state("app.noticias", {网址:/通知",意见:{应用通知":{templateUrl: "templates/noticias.html",控制器:noticiasCtrl"}}}).state('忘记密码', {url: "/forgot-password/:id?tit?bgd?fec?com",templateUrl: "模板/忘记密码.html"})$urlRouterProvider.otherwise("/app/noticias");})

代码:

<ion-content ng-controller="noticiasCtrl" style="top:0"><离子列表><ion-item ng-repeat="item in rawData.slice(1, n)" class="item-noticias overlay" ng-style="{'background':'url(img/'+item.bg +') 无重复中心', 'background-size':'cover'}"><div class="overlay" ui-sref="forgotpassword({ id: item.tipo, tit: item.titulo, bgd:item.bgdetail, com:item, fec:item.fec })"><span class="tipo">{{ item.tipo }}</span><span class="titulo">{{ item.titulo }}</span><span class="link">Leer mas <img src="img/right-arrow.png"></span>

</ion-item></ion-list></离子含量></ion-view>

页面详细信息:

<ion-nav-buttons side="left"><button class="button" ng-click="$ionicGoBack($event)"></button></ion-nav-buttons><ion-content ng-controller="noticiasCtrl" style="top:0"><div class="header-image" ng-style="{'background':'url(img/'+bgd +') no-repeat center', 'background-size':'cover'}"><div class="overlayPrinD"><div class="overlayPrinSecD"><span class="tipo">{{ id }}</span><span class="titulo">{{ tit }}</span>

<p class="fec">{{fec }}</p><p class="texto">{{ com }}</p></离子含量></ion-view>

解决方案

我没有看到您在标记中的任何地方使用 ion-tab 指令.我无法从您的问题中判断哪些视图应该在选项卡中,因此您可以使用以下通用解决方案作为示例:

//路由.state('dashboard.tabs', {网址:/标签",摘要:真实,templateUrl: "templates/tab-container.html"}).state('dashboard.tab1', {网址:/tab1",意见:{'tab1-tab':{templateUrl: "templates/tab1.html",控制器:'Tab1Ctrl 作为 vm',}}}).state('dashboard.tab2', {网址:/tab2",意见:{'tab2-tab':{templateUrl: "templates/tabs2.html",控制器:'Tab2Ctrl 作为 vm',}}})//tab-container.html 模板的标签标记<ion-view view-title="Some Title"><ion-tabs class="tabs-positive"><ion-tab title="Tab 1" ui-sref="some.route.item1"><ion-nav-view name="tab1-tab"></ion-nav-view></ion-tab><ion-tab title="Tab 2" ui-sref="some.route.item2"><ion-nav-view name="tab2-tab"></ion-nav-view></ion-tab></ion-tabs></ion-view>//Tab1 和/或 Tab2 模板<ion-view view-title="Tab #"><离子含量>//你的内容</离子含量></ion-view>

您还可以使用带有 ng-template 的脚本标签在容器模板中包含单个选项卡标记.

I have a problem, i have a code that I have displayed item which lead me to a page where shows detail of each item but this page does not show me the " ion -tab "

Any help

Thank You

Annex codes:

router:

.config(function($stateProvider, $urlRouterProvider, $ionicConfigProvider){     
    $ionicConfigProvider.navBar.alignTitle("center");       
    $stateProvider
        .state("app",{
            templateUrl: "templates/app.html",
            url: "/app",
            abstract: true
        })
        .state("app.noticias", {
            url: "/noticias",
            views: {
                "app-noticias":{
                    templateUrl: "templates/noticias.html",
                    controller: "noticiasCtrl"
                }
            }
        })                  
        .state('forgotpassword', {
          url: "/forgot-password/:id?tit?bgd?fec?com",
          templateUrl: "templates/forgot-password.html"
        })          
        $urlRouterProvider.otherwise("/app/noticias");

})

code:

<ion-view title="Noticias">    
    <ion-content ng-controller="noticiasCtrl" style="top:0">              
          <ion-list>
            <ion-item ng-repeat="item in rawData.slice(1, n)" class="item-noticias overlay" ng-style="{'background':'url(img/'+item.bg +') no-repeat center', 'background-size':'cover'}">                
                <div class="overlay" ui-sref="forgotpassword({ id: item.tipo, tit: item.titulo, bgd:item.bgdetail, com:item, fec:item.fec })">       
                    <span class="tipo">{{ item.tipo }}</span>
                    <span class="titulo">{{ item.titulo }}</span>
                    <span class="link">Leer mas <img src="img/right-arrow.png"></span>                    
                </div>                        
            </ion-item>
          </ion-list>             
      </ion-content>    
</ion-view>

Page detail:

<ion-view title="forgotpassword">
  <ion-nav-buttons side="left">
    <button class="button" ng-click="$ionicGoBack($event)"></button>
  </ion-nav-buttons>
  <ion-content ng-controller="noticiasCtrl" style="top:0">    
    <div class="header-image" ng-style="{'background':'url(img/'+bgd +') no-repeat center', 'background-size':'cover'}">
    <div class="overlayPrinD"> 
      <div class="overlayPrinSecD">                 
            <span class="tipo">{{ id }}</span>
            <span class="titulo">{{ tit }}</span>                               
      </div>                
    </div>       
  </div>
  <p class="fec">{{ fec }}</p>
  <p class="texto">{{ com }}</p>
  </ion-content>
</ion-view>

解决方案

I don't see you using the ion-tab directive anywhere in the markup. I can't tell from your question which views are supposed to be in the tabs, so here's generic solution you can use as an example:

// Routes
.state('dashboard.tabs', {
    url: "/tabs",
    abstract: true,
    templateUrl: "templates/tab-container.html"
})

.state('dashboard.tab1', {
    url: "/tab1",
    views: {
        'tab1-tab': {
            templateUrl: "templates/tab1.html",
            controller: 'Tab1Ctrl as vm',
        }
    }
})

.state('dashboard.tab2', {
    url: "/tab2",
    views: {
        'tab2-tab': {
            templateUrl: "templates/tabs2.html",
            controller: 'Tab2Ctrl as vm',
        }
    }
})

// Tab markup for tab-container.html template
<ion-view view-title="Some Title">
    <ion-tabs class="tabs-positive">

        <ion-tab title="Tab 1" ui-sref="some.route.item1">
            <ion-nav-view name="tab1-tab"></ion-nav-view>
        </ion-tab>

        <ion-tab title="Tab 2" ui-sref="some.route.item2">
            <ion-nav-view name="tab2-tab"></ion-nav-view>
        </ion-tab>

    </ion-tabs>
</ion-view>

// Tab1 and/or Tab2 templates
<ion-view view-title="Tab #">
    <ion-content>
        // Your content
    </ion-content>
</ion-view>

You could also include the individual tab markup in the container template using script tags with ng-template.

<script id="templates/tab1.html" type="text/ng-template">
  <ion-view view-title="Tab 1">
    <ion-content class="padding">
      <p>
        // Your content
      </p>
    </ion-content>
  </ion-view>
</script>

这篇关于不显示“ion-tab"在页面详细信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-21 17:04:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1007809.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:ion

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!