RuleEditor.vue 630 Bytes
Newer Older
David Foucher's avatar
David Foucher committed
1
<template v-show="isEditMode">
2 3 4
  <div id="editor">
    <vue-editor v-model="content" :editorToolbar="customToolbar"></vue-editor>
  </div>
David Foucher's avatar
David Foucher committed
5 6 7 8 9
</template>

<script>
 import { VueEditor } from 'vue2-editor'

10 11 12 13 14 15 16 17 18 19 20 21 22
  export default {
    name: 'RuleEditor',
    components: {
        VueEditor
    },
    props: {
      rawRule: Text,
      isEditMode: {
        type: Boolean,
        default: false
      }
    },
    data() {
David Foucher's avatar
David Foucher committed
23 24 25 26 27
      return {
        content: this.rawRule,
        customToolbar: ['code-block']
      }
    },
28 29 30 31
    method: {
      save: function(){
        this.$parent.updatedRule = this.content
      }
David Foucher's avatar
David Foucher committed
32 33 34
    }
  }
</script>