File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
docs/demo/examples/Interactive Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 77 class =" cm-component"
88 :border =" store.border"
99 @ready =" onReady"
10+ @blur =" onBlur"
11+ @focus =" onFocus"
1012 />
1113</template >
1214<script lang="ts" setup>
@@ -40,6 +42,7 @@ const cmOptions: EditorConfiguration = reactive({
4042 scrollbarStyle: " simple" ,
4143 showCursorWhenSelecting: true ,
4244 styleSelectedText: true ,
45+ styleActiveLine: false ,
4346});
4447
4548const cminstance = ref <Editor | null >(null );
@@ -48,6 +51,17 @@ const onReady = (cm: Editor) => {
4851 console .log (cm .getValue ());
4952};
5053
54+ /** @description */
55+ const onBlur = (cm : Editor ) => {
56+ console .log (" onBlur" , cm );
57+ cm .setOption (" styleActiveLine" , false );
58+ };
59+ /** @description */
60+ const onFocus = (cm : Editor ) => {
61+ console .log (" onBlur" , cm );
62+ cm .setOption (" styleActiveLine" , true );
63+ };
64+
5165const _fontSize = computed (() => store .fontSize || " 13px" );
5266const _lineHeight = computed (() => store .lineHeight || " 20px" );
5367
You can’t perform that action at this time.
0 commit comments