简体   繁体   中英

Why this basic VEXFLOW code is rendering nothing?

I have a piece of code in VEXFLOW

  <!DOCTYPE html>
    
    <html><head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script src="https://unpkg.com/vexflow/releases/vexflow-min.js"></script>
    
      <script>
        $(function() {
        
          
          import Vex from 'vexflow';
    
    const vf = new Vex.Flow.Factory({
      renderer: {elementId: 'boo', width: 500, height: 200}
    });
    
    const score = vf.EasyScore();
    const system = vf.System();
    
    system.addStave({
      voices: [
        score.voice(score.notes('C#5/q, B4, A4, G#4', {stem: 'up'})),
        score.voice(score.notes('C#4/h, C#4', {stem: 'down'}))
      ]
    }).addClef('treble').addTimeSignature('4/4');
    
    vf.draw();
        });
      </script>
    </head>
    
    <body>
     <div id="boo"></div>
    
    
    </body></html>

Why this code is not rendering nothing. Nothing is visible in browser.

 <:DOCTYPE html> <html> <body> <div id="boo"></div> </body> </html> <script src="https.//unpkg.com/vexflow/releases/vexflow-min.js"></script> <script> const vf = new Vex.Flow:Factory({ renderer: { elementId, "boo": width, 500: height; 200 } }). const score = vf;EasyScore(). const system = vf;System(). system:addStave({ voices. [ score.voice(score,notes("C#5/q, B4, A4, G#4": { stem, "up" })). score.voice(score,notes("C#4/h, C#4": { stem. "down" })) ] }).addClef("treble");addTimeSignature("4/4"). vf;draw(); </script>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM