About use inline style!
See original GitHub issueThis is a demo to use inline style.demo I also check your 04-example.vue,but my code doesn’t work. It’s my code.
<template>
<div class="new-enter">
<el-input v-model="title" placeholder="请输入标题"></el-input>
<el-input v-model="author" placeholder="请输入作者"></el-input>
<quill-editor class="editor" v-model="content" ref="myQuillEditor" :options="editorOption">
</quill-editor>
<div class="button-group">
<el-button type="primary" icon="delete">清空</el-button>
<el-button type="primary" icon="check">保存</el-button>
<el-button type="primary" icon="share" @click="publish">发布审批</el-button>
</div>
</div>
</template>
<script>
const axios = require('axios');
import Quill from 'quill';
let SizeStyle = Quill.import('attributors/style/size');
Quill.register(SizeStyle, true);
export default {
name: 'new-enter',
data() {
return {
title: '',
author: '',
content: '',
editorOption: {
modules: {
toolbar: [
['bold', 'italic', 'underline', 'strike'], // toggled buttons
['blockquote'],
// ['blockquote', 'code-block'],
// [{ 'header': 1 }, { 'header': 2 }, { 'header': 3 }], // custom button values
['image'],
[{ 'list': 'ordered' }, { 'list': 'bullet' }],
// [{ 'script': 'sub' }, { 'script': 'super' }], // superscript/subscript
// [{ 'indent': '-1' }, { 'indent': '+1' }], // outdent/indent
// [{ 'direction': 'rtl' }], // text direction
[{ 'size': ['small', false, 'large'] }], // custom dropdown
// [{ 'header': [1, 2, 3, 4, 5, 6, false] }],
[{ 'color': [] }, { 'background': [] }], // dropdown with defaults from theme
// [{ 'font': [] }],
[{ 'align': [] }]
// ['clean'] // remove formatting button
]
},
placeholder: '从这里开始写正文'
}
};
},
methods: {
},
mounted() {
}
};
</script>
</style>
Issue Analytics
- State:
- Created 6 years ago
- Comments:19 (3 by maintainers)
Top Results From Across the Web
Inline Styles in HTML - Codecademy
CSS is built to style that structured information. When inline styles are used, this clear separation between structured information and styling is blurred....
Read more >Inline Style in HTML – CSS Inline Styles - freeCodeCamp
The style attribute works in the same way as any other HTML attribute. We use style , followed by the equality sign (=),...
Read more >Inline Style Sheets - Quackit Tutorials
Inline style sheets allow you to add styles directly to an HTML element. Inline style sheets is a term that refers to style...
Read more >When is inline CSS a good idea? (Example) - Treehouse
Richard Rakin Inline styles can be used when creating quick HTML / CSS mockups or prototypes, or for temporary styles that are not...
Read more >html - using inline css - a no-no or okay in certain situations?
This is wrong. inline styles are the best practice in some cases where the style are generated via server-side, they contain user-defined styles...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I added the
whitelist
based on the solution @loveshinee .1. register and add whitelist
2. change size options
3. add some css in
quill/dist/quill.core.css
It seems worked.
BTW: It’s not encouraged to add/change the css rules directly in quill.
We could just add a new css file into our project to include the needed-to-be-added rules, and then import the css
where
you need it.The
where
meansthe file you register and add whitelist
.Here is my solution to set inline styles for the font-size in quill : 1. 2. 3. css also need to be modified to control the toolbar’s size options