S
S
Superdsa2020-02-25 22:30:13
JavaScript
Superdsa, 2020-02-25 22:30:13

What code editor can be inserted into laravel?

We need a code editor that can be inserted into Laravel less problematic.
Tried Brace , but all attempts are in vain
app.js

require('jquery');
require('./ace-editor');

window.Vue = require('vue');

Vue.component('example-component', require('./components/ExampleComponent.vue').default);

//Vue.component('luaeditor', require('./ace-editor'));

const app = new Vue({
    el: '#app',
});

ace-editor.js - the actual code from example could not be found for more detailed documentation
require('brace/mode/javascript');
require('brace/theme/monokai');

var editor = ace.edit('javascript-editor');
editor.getSession().setMode('ace/mode/javascript');
editor.setTheme('ace/theme/monokai');
editor.setValue([
    '// JavaScript'
  , 'var a = 3;'
  , ''
  , '// below line has an error which is annotated'
  , 'var b ='
  ].join('\n')
);
editor.clearSelection();

At the output, the height is automatically 0, when the height is set, the background appears relative to the selected topic, and that's it, there is no text from SetValue and nothing can be written

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Shvets, 2020-02-26
@Superdsa

https://github.surmon.me/vue-codemirror/ for example
In general, there is a collection of components

N
nvdfxx, 2020-02-26
@nvdfxx

codemirror - perfect for Laravel, as well as for any backend, because it has nothing to do with it. There is even a vue version so you don't worry about anything at all

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question