Yii2 Accordion,如何使第一个标签无效

时间:2017-07-21 11:08:01

标签: yii2

echo Accordion::widget([
            'items' => [
                [
                    'header' => 'Section 1',
                    'content' => 'Mauris mauris ante, blandit et, ultrices a, suscipit eget...',
                    'options' => ['tag' => 'div'],
                ],
                [
                    'header' => 'Section 2',
                    'headerOptions' => ['tag' => 'h3'],
                    'content' => 'Sed non urna. Phasellus eu ligula. Vestibulum sit amet purus...',
                    'options' => ['tag' => 'div'],
                ],
            ],
            'options' => ['tag' => 'div'],
            'itemOptions' => ['tag' => 'div'],
            'headerOptions' => ['tag' => 'h2'],
            'clientOptions' => ['collapsible' => true],
        ]);

您好。默认情况下,第一个选项卡是否处于活动状在文档中,我没有找到关于此

的信息

2 个答案:

答案 0 :(得分:0)

解决方案是添加到选项

'active' => false

'clientOptions' => ['collapsible' => true, 'active' => false],

答案 1 :(得分:0)

如果要使第一个选项卡处于非活动状态,而第二个选项卡处于活动状态,请使用

cy.request({ method: 'GET', url: 'https://mailtrap.io/api/v1/inboxes/123/messages?page=1&last_id=&useremail', headers: { 'Api-Token': 'Your Token value' //Replace with real token }, failOnStatusCode: false }).then((res) => { expect(res.status).to.equal(200) //Replace with releveant 2xx response code })