- editor如何取消焦点?
我是使用radio-group组件,绑定数据至editor渲染数据,editor会自动焦点,且弹出键盘。 现在的问题就是会自动焦点和弹出键盘, 怎么取消掉。 <li wx:for="{{diseaseDepot}}"> <radio-group bindchange="radioChangeB"> <label class="weui-cell weui-check__label" wx:key="{{item.value}}"> <view class="weui-cell__hd"> <radio style="transform: scale(0.75)" value="{{item.title}}" checked="{{item.checked}}"/> </view> <view class="weui-cell__bd">{{item.title}}</view> </label> </radio-group> </li> // 单选内容后,数据渲染入editor, 但是默认会焦点此处, 如何取消焦点和键盘 <editor id="editorB" class="ql-container" placeholder="{{placeholder}}" showImgSize showImgToolbar showImgResize bindstatuschange="onStatusChange" read-only="{{readOnly}}" bindready="onEditorReady"> </editor> // 单选事件 radioChangeB(e) { this.data.diseaseDepot.forEach(item => { let p = item; if(p.title == e.detail.value){ let vstar = [1] p.checked = true vstar[0] = p.title vstar[1] = p.content this.onEditorReadyB(vstar[1]) this.setData({ checkedDiseaseBy: vstar }) }else{ p.checked = false } }) // html渲染至editor 组件 onEditorReadyB(vhtml) { const that = this wx.createSelectorQuery().select('#editorB').context(function (res) { if(!res) return that.editorCtx = res.context res.context.setContents({ html: vhtml, focus: false }) }).exec() },
2022-04-11 - radio-group 与 editor 数据绑定渲染后会自动焦点,怎么取消焦点?
我是使用radio-group组件,绑定数据至editor渲染数据,editor会自动焦点,且弹出键盘。 现在的问题就是会自动焦点和弹出键盘, 怎么取消掉。 <li wx:for="{{diseaseDepot}}"> <radio-group bindchange="radioChangeB"> <label class="weui-cell weui-check__label" wx:key="{{item.value}}"> <view class="weui-cell__hd"> <radio style="transform: scale(0.75)" value="{{item.title}}" checked="{{item.checked}}"/> </view> <view class="weui-cell__bd">{{item.title}}</view> </label> </radio-group> </li> // 单选内容后,数据渲染入editor, 但是默认会焦点此处, 如何取消焦点和键盘 <editor id="editorB" class="ql-container" placeholder="{{placeholder}}" showImgSize showImgToolbar showImgResize bindstatuschange="onStatusChange" read-only="{{readOnly}}" bindready="onEditorReady"> </editor> // 单选事件 radioChangeB(e) { this.data.diseaseDepot.forEach(item => { let p = item; if(p.title == e.detail.value){ let vstar = [1] p.checked = true vstar[0] = p.title vstar[1] = p.content this.onEditorReadyB(vstar[1]) this.setData({ checkedDiseaseBy: vstar }) }else{ p.checked = false } }) // html渲染至editor 组件 onEditorReadyB(vhtml) { const that = this wx.createSelectorQuery().select('#editorB').context(function (res) { if(!res) return that.editorCtx = res.context res.context.setContents({ html: vhtml, focus: false }) }).exec() },
2022-04-11