Skip to content

Commit dfdfca6

Browse files
committed
chore: 调整文档中示例
1 parent 4d31d5b commit dfdfca6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/demo/examples/Interactive/demo.vue

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
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
4548
const 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+
5165
const _fontSize = computed(() => store.fontSize || "13px");
5266
const _lineHeight = computed(() => store.lineHeight || "20px");
5367

0 commit comments

Comments
 (0)