-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add view components and refactor editor component
- Loading branch information
1 parent
12d41b3
commit 44a9459
Showing
11 changed files
with
337 additions
and
51 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.ql-container.quill-view-html { | ||
border: 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { h, Component, Prop, Watch } from '@stencil/core'; | ||
|
||
|
||
@Component({ | ||
tag: 'quill-view-html', | ||
scoped: true, | ||
shadow: false, | ||
styleUrl: './quill-view-html.css' | ||
}) | ||
export class QuillViewHTMLComponent { | ||
@Prop() content: string; | ||
@Prop() theme: string = 'snow'; | ||
private themeClass: string = 'ql-snow' | ||
|
||
@Watch('theme') | ||
updateTheme(newValue: string): void { | ||
this.themeClass = `ql-${newValue || 'snow'}` | ||
} | ||
|
||
render() { | ||
const classes = `ql-container ${this.themeClass} quill-view-html` | ||
return ( | ||
<div class={classes}> | ||
<div class="ql-editor" innerHTML={this.content}> | ||
</div> | ||
</div> | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.ql-container.quill-view { | ||
border: 0; | ||
} |
Oops, something went wrong.