File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed
website/src/routes/editConfig/[configName] Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change 2
2
import { onMount } from ' svelte' ;
3
3
import type { Readable } from ' svelte/store' ;
4
4
import { createEditor , Editor , EditorContent } from ' svelte-tiptap' ;
5
- import StarterKit from ' @tiptap/starter-kit' ;
5
+ import StarterKit from ' @tiptap/starter-kit' ;
6
6
import { page } from ' $app/stores' ;
7
7
8
8
let isLoading = true ;
28
28
29
29
const save = () => {
30
30
console .log ($editor );
31
- console .log ($editor ?.getHTML ());
31
+ console .log ($editor ?.getHTML ());
32
32
};
33
33
34
34
const revert = () => {
43
43
44
44
onMount (async () => {
45
45
console .log (' onMount' );
46
- let configContent = await getConfig (configName )
46
+ let configContent = await getConfig (configName );
47
47
editor = createEditor ({
48
48
extensions: [StarterKit ],
49
49
content: configContent
50
50
});
51
51
});
52
52
</script >
53
53
54
- <div class =" p-2 whitespace-pre-wrap" >
55
- <!-- {#if html !== 'Loading content...'} -->
56
- <EditorContent editor ={$editor } />
57
- <!-- {:else} -->
58
- <!-- <p>Loading config...</p> -->
59
- <!-- {/if} -->
60
-
54
+ <div class =" p-2" >
55
+ <div class =" border border-gray-200 p-2 text-sm" >
56
+ <EditorContent editor ={$editor } />
57
+ </div >
61
58
<button class ="mt-2 mr-2" on:click ={save }>Save</button >
62
59
<button class ="mt-2 bg-gray-500" on:click ={revert }>Revert</button >
63
60
</div >
You can’t perform that action at this time.
0 commit comments