File tree Expand file tree Collapse file tree 5 files changed +14
-5
lines changed Expand file tree Collapse file tree 5 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 12
12
import { ref , defineComponent } from " vue" ;
13
13
import { MergeView } from " codemirror/addon/merge/merge" ;
14
14
import { Editor } from " codemirror" ;
15
- import Codemirror from " @/index" ;
15
+ import Codemirror from " codemirror-editor-vue3" ;
16
+
16
17
import " codemirror/mode/htmlmixed/htmlmixed.js" ;
17
18
18
19
export default defineComponent ({
Original file line number Diff line number Diff line change 11
11
<script lang="ts">
12
12
import { ref } from " vue" ;
13
13
import { EditorConfiguration } from " codemirror" ;
14
- import Codemirror from " @/index " ;
14
+ import Codemirror from " codemirror-editor-vue3 " ;
15
15
16
16
// language
17
17
import " codemirror/mode/javascript/javascript.js" ;
@@ -32,10 +32,13 @@ export default defineComponent({
32
32
33
33
cmPlaceholder .value += " 1 " ;
34
34
35
- setInterval (() => {
35
+ const timer = setInterval (() => {
36
36
cmPlaceholder .value += " 1 " ;
37
37
console .log (cmPlaceholder .value );
38
38
}, 2000 );
39
+ onUnmounted (() => {
40
+ clearInterval (timer );
41
+ });
39
42
return {
40
43
code ,
41
44
cmOptions ,
Original file line number Diff line number Diff line change 8
8
<script lang="ts">
9
9
import { ref } from " vue" ;
10
10
import { EditorConfiguration } from " codemirror" ;
11
- import Codemirror from " @/index " ;
11
+ import Codemirror from " codemirror-editor-vue3 " ;
12
12
13
13
// language
14
14
import " codemirror/mode/javascript/javascript.js" ;
Original file line number Diff line number Diff line change 18
18
"forceConsistentCasingInFileNames" : true ,
19
19
"paths" : {
20
20
"@/*" : [" packages/*" ],
21
- "./*" : [" ./*" ]
21
+ "./*" : [" ./*" ],
22
+ "codemirror-editor-vue3" : [" packages/index.ts" ]
22
23
}
23
24
},
24
25
"include" : [
Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ const viteCfg = defineConfig({
20
20
find : / @ \/ / ,
21
21
replacement : `${ pathResolve ( "packages/" ) } /` ,
22
22
} ,
23
+ {
24
+ find : "codemirror-editor-vue3" ,
25
+ replacement : `${ pathResolve ( "packages/index.ts" ) } ` ,
26
+ } ,
23
27
] ,
24
28
} ,
25
29
// 生产环境路径,类似webpack的assetsPath
You can’t perform that action at this time.
0 commit comments