Browse Source

Add guideline.js

pull/10/head
Hironsan 6 years ago
parent
commit
19a59108f6
1 changed files with 36 additions and 0 deletions
  1. 36
      app/server/static/js/guideline.js

36
app/server/static/js/guideline.js

@ -0,0 +1,36 @@
import Vue from 'vue';
import HTTP from './http';
const vm = new Vue({
el: '#editor',
data: {
input: '# hello',
project: Object,
},
computed: {
compiledMarkdown() {
return marked(this.input, {
sanitize: true,
});
},
},
created() {
HTTP.get().then((response) => {
this.input = response.data.guideline;
this.project = response.data;
});
},
methods: {
update: _.debounce(function(e) {
this.input = e.target.value;
this.project.guideline = this.input;
HTTP.put('', this.project).then((response) => {
this.project = response.data;
});
}, 300),
},
});
Loading…
Cancel
Save