Forum > Pas2JS

My hello world

(1/1)

lainz:
Well, finally I left vue with Pas2js due I can't find the way. But made the same Vue.js demo in no time with regular Pas2js.


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---program pas2jsvue; {$mode objfpc} uses  JS,  Classes,  SysUtils,  StrUtils,  Web; var message: TJSElement; button1: TJSElement;begin message := document.getElementById('message'); button1 := document.getElementById('button1');  button1.addEventListener('click', procedure  begin    message.innerText := ReverseString(message.innerText);  end);end.

--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---<!doctype html><html lang="en"><head>  <meta charset="utf-8">  <title>Pas2JS Vue</title></head><body>  <div id="app">  <p id='message'>Hello World</p>  <button id='button1'>Reverse Message</button>  </div>  <script src="./pas2jsvue.js"></script>  <script>  rtl.run();   </script>  </body></html>    

Navigation

[0] Message Index

Go to full version