<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>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                #### textarea 多行輸入框。 | 屬性名 | 類型 | 默認值 | 說明 | 最低版本 | | ----------------- | ----------- | -------------------- | ---------------------------------------- | ---------------------------------------- | | value | String | | 輸入框的內容 | | | placeholder | String | | 輸入框為空時占位符 | | | placeholder-style | String | | 指定 placeholder 的樣式 | | | placeholder-class | String | textarea-placeholder | 指定 placeholder 的樣式類 | | | disabled | Boolean | false | 是否禁用 | | | maxlength | Number | 140 | 最大輸入長度,設置為 -1 的時候不限制最大長度 | | | auto-focus | Boolean | false | 自動聚焦,拉起鍵盤。 | | | focus | Boolean | false | 獲取焦點 | | | auto-height | Boolean | false | 是否自動增高,設置auto-height時,style.height不生效 | | | fixed | Boolean | false | 如果 textarea 是在一個 `position:fixed` 的區域,需要顯示指定屬性 fixed 為 true | | | cursor-spacing | Number | 0 | 指定光標與鍵盤的距離,單位 px 。取 textarea 距離底部的距離和 cursor-spacing 指定的距離的最小值作為光標與鍵盤的距離 | | | cursor | Number | | 指定focus時的光標位置 | [1.5.0](https://mp.weixin.qq.com/debug/wxadoc/dev/framework/compatibility.html) | | show-confirm-bar | Boolean | true | 是否顯示鍵盤上方帶有”完成“按鈕那一欄 | [1.6.0](https://mp.weixin.qq.com/debug/wxadoc/dev/framework/compatibility.html) | | selection-start | Number | -1 | 光標起始位置,自動聚集時有效,需與selection-end搭配使用 | [1.9.0](https://mp.weixin.qq.com/debug/wxadoc/dev/framework/compatibility.html) | | selection-end | Number | -1 | 光標結束位置,自動聚集時有效,需與selection-start搭配使用 | [1.9.0](https://mp.weixin.qq.com/debug/wxadoc/dev/framework/compatibility.html) | | bindfocus | EventHandle | | 輸入框聚焦時觸發,event.detail = {value: value} | | | bindblur | EventHandle | | 輸入框失去焦點時觸發,event.detail = {value, cursor} | | | bindlinechange | EventHandle | | 輸入框行數變化時調用,event.detail = {height: 0, heightRpx: 0, lineCount: 0} | | | bindinput | EventHandle | | 當鍵盤輸入時,觸發 input 事件,event.detail = {value, cursor},**bindinput 處理函數的返回值并不會反映到 textarea 上** | | | bindconfirm | EventHandle | | 點擊完成時, 觸發 confirm 事件,event.detail = {value: value} | | **示例代碼:** ``` <!--textarea.wxml--> <view class="section"> <textarea bindblur="bindTextAreaBlur" auto-height placeholder="自動變高" /> </view> <view class="section"> <textarea placeholder="placeholder顏色是紅色的" placeholder-style="color:red;" /> </view> <view class="section"> <textarea placeholder="這是一個可以自動聚焦的textarea" auto-focus /> </view> <view class="section"> <textarea placeholder="這個只有在按鈕點擊的時候才聚焦" focus="{{focus}}" /> <view class="btn-area"> <button bindtap="bindButtonTap">使得輸入框獲取焦點</button> </view> </view> <view class="section"> <form bindsubmit="bindFormSubmit"> <textarea placeholder="form 中的 textarea" name="textarea"/> <button form-type="submit"> 提交 </button> </form> </view> ``` ``` //textarea.js Page({ data: { height: 20, focus: false }, bindButtonTap: function() { this.setData({ focus: true }) }, bindTextAreaBlur: function(e) { console.log(e.detail.value) }, bindFormSubmit: function(e) { console.log(e.detail.value.textarea) } }) ``` ##### Bug & Tip 1. `bug`: 微信版本 `6.3.30`,`textarea` 在列表渲染時,新增加的 `textarea` 在自動聚焦時的位置計算錯誤。 2. `tip`: `textarea` 的 `blur` 事件會晚于頁面上的 `tap` 事件,如果需要在 `button` 的點擊事件獲取 `textarea`,可以使用 `form` 的 `bindsubmit`。 3. `tip`: 不建議在多行文本上對用戶的輸入進行修改,所以 `textarea` 的 `bindinput` 處理函數并不會將返回值反映到 `textarea` 上。 4. `tip`: `textarea` 組件是由客戶端創建的原生組件,它的層級是最高的,不能通過 z-index 控制層級。 5. `tip`: 請勿在 `scroll-view`、`swiper`、`picker-view`、`movable-view` 中使用 `textarea` 組件。 6. `tip`: `css` 動畫對 `textarea` 組件無效。
                  <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>

                              哎呀哎呀视频在线观看