vue2-ace-editor icon indicating copy to clipboard operation
vue2-ace-editor copied to clipboard

Example: linting/validation

Open SelfhostedPro opened this issue 4 years ago • 1 comments

Hey, I was wondering if you'd consider throwing up a sample for enabling linting/validation? I'm trying to get mine setup with YAML but I'm not really sure to start.

So far I've got it working with the following in template tags:

        <editor
          v-model="form.content"
          @init="editorInit"
          lang="yaml"
          :theme='editorTheming()'
          :height="windowHeight"
          :width="windowWidth"
          class="editor"
        ></editor>

and the following in script tags:

  components: {
    editor: require("vue2-ace-editor")
  },
  methods: {
    editorInit() {
      require("brace/mode/yaml");
      require("brace/theme/twilight");
      require("brace/theme/textmate");
    },
    editorTheming(){
      if ( this.$vuetify.theme.dark == false) {
        return "textmate"
      } else {
        return "twilight"
      }
    },

This works great and has auto light/darkmode to match my theme but no syntax highlighting or errors.

SelfhostedPro avatar Jan 08 '21 01:01 SelfhostedPro

same request

truemoroz avatar Mar 11 '21 08:03 truemoroz