<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                ## addSwitch('name值', '標題' [, '提示', '默認值', '屬性', '額外屬性', '額外css類']) 標識符:`switch` | 參數 | 含義 | 類型 | | --- | --- | --- | | name | name值 | string | | title | 標題 | string | | tips | 提示 | string | | default | 默認值 | string | | attr | 屬性 | array | | extra_attr | 額外屬性 | string | | extra_class | 額外css類 | string | ### 依然舉個栗子 ~~~ return ZBuilder::make('form') ->addSwitch('web_site_status', '站點開關') ->fetch(); ~~~ ![](https://box.kancloud.cn/31b1a3ee0f0272ca4197c30e62ce1cdc_177x88.png) ### 設置默認值 開關的默認值是空,也就是關閉狀態,如果需要設置為開啟狀態,可以這樣設置 >[info] 只要默認值不為空,不是0或者'0',其他情況都是開啟狀態 ~~~ return ZBuilder::make('form') ->addSwitch('web_site_status', '站點開關', '', '1') ->fetch(); ~~~ ![](https://box.kancloud.cn/33d711e08ec72813d7c23bfab5bf6d13_246x79.png) >[danger] 注意:如果開關為關閉狀態時,提交表單的時候不會發送該表單項的name值,打開狀態時才會,并且值為“on”。 >開發者需要自行判斷是否有該項。 ### 定義屬性 可以設置顏色、尺寸、形狀 #### 顏色(color) * `primary` (默認) * `default` * `info` * `success` * `warning` * `danger` ~~~ return ZBuilder::make('form') ->addSwitch('web_site_status', '站點開關', '', '1', ['color' => 'danger']) ->fetch(); ~~~ ![](https://box.kancloud.cn/083fa28d5172cc831db02f4afbf4f23e_100x70.png) #### 尺寸(size) * `sm` (默認) * `nm` * `lg` ~~~ return ZBuilder::make('form') ->addSwitch('web_site_status', '站點開關', '', '1', ['size' => 'lg']) ->fetch(); ~~~ ![](https://box.kancloud.cn/b9eb157508a028eb9cd31c2b36badbb6_134x68.png) #### 形狀(shape) * `rounded` (默認) * `square` ~~~ return ZBuilder::make('form') ->setPageTitle('添加') ->addSwitch('web_site_status', '站點開關', '', '1', ['shape' => 'square']) ->fetch(); ~~~ ![](https://box.kancloud.cn/63dbbb35e783a3a576db81176c8cc9bf_137x62.png) 三種屬性可以一起使用 ~~~ return ZBuilder::make('form') ->setPageTitle('添加') ->addSwitch('web_site_status', '站點開關', '', '1', ['color' => 'danger', 'size' => 'lg', 'shape' => 'square']) ->fetch(); ~~~ ### 添加額外屬性 比如默認為禁用狀態 ~~~ return ZBuilder::make('form') ->setPageTitle('添加') ->addSwitch('web_site_status', '站點開關', '', '1', '', 'disabled') ->fetch(); ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看