parent
b1d1fa4880
commit
58c28b776b
@ -0,0 +1,21 @@ |
||||
import { query } from './table-editor-utils' |
||||
|
||||
export default function (dataRoute) { |
||||
let $note = $('#field-note') |
||||
let lastText = $note.val() |
||||
|
||||
let handler = _.debounce(function () { |
||||
query(dataRoute, { |
||||
action: 'note.set', |
||||
text: lastText |
||||
}) |
||||
}, 350) |
||||
|
||||
$note.on('input', () => { |
||||
let text = $note.val() |
||||
if (text !== lastText) { |
||||
lastText = text |
||||
handler() |
||||
} |
||||
}) |
||||
} |
@ -1,21 +1,23 @@ |
||||
import DraftNotePage from './components/DraftNotePage' |
||||
|
||||
window.Vue = require('vue') |
||||
|
||||
const ColumnEditor = Vue.component('column-editor', require('./components/ColumnEditor.vue')) |
||||
const RowsEditor = Vue.component('rows-editor', require('./components/RowsEditor.vue')) |
||||
const Icon = Vue.component('v-icon', require('./components/Icon.vue')) |
||||
|
||||
// const app = new Vue({
|
||||
// el: '#app'
|
||||
// });
|
||||
|
||||
window.app = { |
||||
ColumnEditor: function (selector, data) { |
||||
ColumnEditor (selector, data) { |
||||
return new ColumnEditor({ propsData: data }).$mount(selector) |
||||
}, |
||||
RowsEditor: function (selector, data) { |
||||
|
||||
RowsEditor (selector, data) { |
||||
return new RowsEditor({ propsData: data }).$mount(selector) |
||||
}, |
||||
Icon: function (selector, data) { |
||||
|
||||
Icon (selector, data) { |
||||
return new Icon({ propsData: data }).$mount(selector) |
||||
} |
||||
}, |
||||
|
||||
DraftNotePage |
||||
} |
||||
|
Loading…
Reference in new issue