Skip to content

Commit

Permalink
chore: 调整文档中示例
Browse files Browse the repository at this point in the history
  • Loading branch information
rennzhang committed Sep 5, 2024
1 parent 4d31d5b commit dfdfca6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/demo/examples/Interactive/demo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
class="cm-component"
:border="store.border"
@ready="onReady"
@blur="onBlur"
@focus="onFocus"
/>
</template>
<script lang="ts" setup>
Expand Down Expand Up @@ -40,6 +42,7 @@ const cmOptions: EditorConfiguration = reactive({
scrollbarStyle: "simple",
showCursorWhenSelecting: true,
styleSelectedText: true,
styleActiveLine: false,
});
const cminstance = ref<Editor | null>(null);
Expand All @@ -48,6 +51,17 @@ const onReady = (cm: Editor) => {
console.log(cm.getValue());
};
/** @description */
const onBlur = (cm: Editor) => {
console.log(" onBlur", cm);
cm.setOption("styleActiveLine", false);
};
/** @description */
const onFocus = (cm: Editor) => {
console.log(" onBlur", cm);
cm.setOption("styleActiveLine", true);
};
const _fontSize = computed(() => store.fontSize || "13px");
const _lineHeight = computed(() => store.lineHeight || "20px");
Expand Down

0 comments on commit dfdfca6

Please sign in to comment.