소스 검색

不自动聚焦

lifanagju_citu 1 개월 전
부모
커밋
cbc59ceb1c
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      components/RichEditor/index.vue

+ 5 - 1
components/RichEditor/index.vue

@@ -36,6 +36,7 @@
 						class="ql-container"
 						class="ql-container"
 						placeholder="开始输入..."
 						placeholder="开始输入..."
 						show-img-size show-img-toolbar show-img-resize
 						show-img-size show-img-toolbar show-img-resize
+						:auto-focus="autoFocus"
 						@statuschange="onStatusChange"
 						@statuschange="onStatusChange"
 						@ready="onEditorReady"
 						@ready="onEditorReady"
 						@input="onInputChange"
 						@input="onInputChange"
@@ -64,6 +65,10 @@
 				default: 0,
 				default: 0,
 				validator: value => value >= 0
 				validator: value => value >= 0
 			},
 			},
+			autoFocus: {
+				type: Boolean,
+				default: false
+			},
 			richValue: {
 			richValue: {
 				type: String,
 				type: String,
 				default: ''
 				default: ''
@@ -152,7 +157,6 @@
 				// #ifdef APP-PLUS || MP-WEIXIN || H5
 				// #ifdef APP-PLUS || MP-WEIXIN || H5
 				this.createSelectorQuery().select('#editor').context((res) => {
 				this.createSelectorQuery().select('#editor').context((res) => {
 					this.editorCtx = res.context
 					this.editorCtx = res.context
-					
 					this.setEditorContent(this.richValue)
 					this.setEditorContent(this.richValue)
 				}).exec()
 				}).exec()
 				// #endif	
 				// #endif