123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Vue.js markdown editor example</title>
- <link rel="stylesheet" href="css/style.css">
- <script src="https://unpkg.com/lodash@4.16.0"></script>
- <!-- Delete ".min" for console warnings in development -->
- <script src="js/vue.js"></script>
- </head>
- <body>
- <div id="app">
- <textarea v-model="input" cols="80" rows="20"></textarea>
- <button v-on:click="send">send</button>
- <div v-html="compiledMarkdown"></div>
- </div>
- <script>
- new Vue({
- el: '#app',
- data: {
- input: '// rde.writeCmd("set_digital_out(2,True)");\n' +
- '// rde.writeCmd("movej([-1.95,-1.58,-1.16,-1.15,-1.55,1.25], a=1.0, v=0.1)");\n' +
- '//rde.writeCmd("freedrive_mode()");\n'
- },
- methods: {
- send: function (event) {
- fetch('/cmd', {method: "POST", body: this.input})
- .then(function(response) {
- return response;
- });
- },
- update: _.debounce(function (e) {
- this.input = e.target.value
- }, 300)
- }
- })
- </script>
- </body>
- </html>
|