gpt4 book ai didi

angularjs - 让 Angular Bootstrap Accordion 发挥作用

转载 作者:行者123 更新时间:2023-12-02 11:27:32 26 4
gpt4 key购买 nike

我没有运气让 Accordion 从这个仓库工作:https://github.com/angular-ui/bootstrap

似乎标题没有显示,我不知道为什么。

HTML:

<!doctype html>
<html ng-app="myApp">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Angular UI Test</title>
<meta charset="utf-8" />
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.min.js"></script>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap-combined.min.css" />
<script src="https://raw.github.com/angular-ui/bootstrap/master/src/accordion/accordion.js"></script>
<script src="app.js"></script>
<style type="text/css">
.wrap {width:960px;margin:0 auto;}
</style>
</head>
<body>
<div class="wrap" ng-controller="MyCtrl">
<accordion>
<accordion-group title="Title">This has a one word title.</accordion-group>
<accordion-group title="Title2">This also has a one word title.</accordion-group>
<accordion-group title="Title With Spaces">This has a title with spaces!</accordion-group>
</accordion>
</div>
</body>

JS:

var myApp = angular.module('myApp',['ui.bootstrap.accordion']);

function MyCtrl($scope) {
}

最佳答案

您需要使用“”来包裹标题

这里有 3 种不同的设置方法

<accordion>
<accordion-group title="title">This has a one word title.</accordion-group>
<accordion-group title="Title2='Title 2' ">This also has a one word title.</accordion-group>
<accordion-group title=" 'Title 3' ">This has a title with spaces!</accordion-group>
</accordion>

这是工作plunker

关于angularjs - 让 Angular Bootstrap Accordion 发挥作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13205966/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com