question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is there a way to set global options?

See original GitHub issue

Looking to set global Quill configuration options, particularly in app.js to use globally across all my components.

Please advise?

Currently trying:

import VueQuillEditor from 'vue-quill-editor';

Vue.use(VueQuillEditor, {
	options: {
		modules: {
	        toolbar: [[
	      		{ 'color': colorGrid }, 
	      		{ 'background': colorGrid }
	      	]]
	    }
	}
})

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
surmon-chinacommented, Dec 3, 2017

@mbarwick83

In my local test, it work well.

entry:


import Vue from 'vue'
import App from './App.vue'
import buildApp from '@/main.js'

import VueQuillEditor, { quillEditor } from 'vue-quill-editor'
import VueQuillEditorSSR from 'vue-quill-editor/dist/ssr'
console.log('VueQuillEditor', VueQuillEditor, quillEditor)

require('quill/dist/quill.core.css')
require('quill/dist/quill.snow.css')
require('quill/dist/quill.bubble.css')

const defaultOptions = {
  theme: 'snow',
  modules: {
    toolbar: [
      [{ 'header': [1, 2, 3, 4, 5, 6, false] }],
    ]
  },
  placeholder: 'Global placeholder...'
}

Vue.use(VueQuillEditor, defaultOptions)
Vue.use(VueQuillEditorSSR, defaultOptions)
buildApp(App)

component:

<quill-editor ref="myTextEditor"
                      :options="editorOption1"
                      v-model="content"
                      @blur="onEditorBlur($event)"
                      @focus="onEditorFocus($event)"
                      @ready="onEditorReady($event)">
</quill-editor>
export default {
    data() {
      return {
        name: 'base-example',
        content: '<p><br><p>',
        editorOption1: {
          modules: {
            toolbar: [
              ['bold', 'italic', 'underline', 'strike'],
              ['blockquote', 'code-block'],
              [{ 'header': 1 }, { 'header': 2 }],
              [{ 'list': 'ordered'}, { 'list': 'bullet' }],
              [{ 'script': 'sub'}, { 'script': 'super' }],
              [{ 'indent': '-1'}, { 'indent': '+1' }],
              [{ 'direction': 'rtl' }],
            ]
          },
          // placeholder: 'Compose an epic...'
        }
      }
    }
  }
}

I can get:

image

0reactions
mbarwick83commented, Dec 3, 2017

@surmon-china I did, couple comments above.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Generate Global Options
Here the GlobalOptions package provides a more general and controlable way to generate such functions, which can: validate the values (e.g. ...
Read more >
Set global options - BMC Documentation
Select option 2 from the primary menu to access panels that let you set global options. The Global Options panel is displayed. See...
Read more >
How to set global options? - MATLAB Answers - MathWorks
Im trying to set global options so I can no longer set them in my code, like this: Theme. Copy to Clipboard ......
Read more >
Setting Global Options - Oracle Help Center
To access the global options, on the sidebar, select Options, and in the Options section, expand Global. For information about setting global options,...
Read more >
Options Settings - R
Description. Allow the user to set and examine a variety of global options which affect the way in which R computes and displays...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found