File tree 1 file changed +14
-0
lines changed
docs/demo/examples/Interactive
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 7
7
class =" cm-component"
8
8
:border =" store.border"
9
9
@ready =" onReady"
10
+ @blur =" onBlur"
11
+ @focus =" onFocus"
10
12
/>
11
13
</template >
12
14
<script lang="ts" setup>
@@ -40,6 +42,7 @@ const cmOptions: EditorConfiguration = reactive({
40
42
scrollbarStyle: " simple" ,
41
43
showCursorWhenSelecting: true ,
42
44
styleSelectedText: true ,
45
+ styleActiveLine: false ,
43
46
});
44
47
45
48
const cminstance = ref <Editor | null >(null );
@@ -48,6 +51,17 @@ const onReady = (cm: Editor) => {
48
51
console .log (cm .getValue ());
49
52
};
50
53
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
+
51
65
const _fontSize = computed (() => store .fontSize || " 13px" );
52
66
const _lineHeight = computed (() => store .lineHeight || " 20px" );
53
67
You can’t perform that action at this time.
0 commit comments