1
0

More than 5 years have passed since last update.

riot.js ace tagを作る。

Last updated at Posted at 2018-04-10

日本語の変換に目をつぶればace editorは簡単。

<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.3.3/ace.js" type="text/javascript" charset="utf-8"></script>
<script src="//gnjo.github.io/riot.js"></script>
<ace></ace>
<ace></ace>
<ace></ace>
<ace></ace>
<ace></ace>
<ace></ace>
riot.tag(`ace`
,`<pre ref="code"></pre>`
,function(opt){
 let ed=null;
 this.one('mount',function(){
     ed = ace.edit(this.refs.code,{
        maxLines: 30,
        wrap: true,
        autoScrollEditorIntoView: true
    })      
     ed.setTheme("ace/theme/solarized_dark");
     ed.session.setMode("ace/mode/javascript");
 })
})       
;
riot.mount('ace')
;
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0