JSFiddle - React, Tailwind, and code Playground

by imall

HTML

<script src="https://unpkg.com/[email protected]/dist/vue.global.js"></script>
 <div id="app" >
    {{ count }}

    <button @click="plus">點選讓數字加一</button>
    
 </div>

JavaScript

const { createApp, ref } = Vue;
     const app = createApp({
         setup() {
            let count = 0;
            const plus  = () => {
                count++;
                console.log(count);
            }
            return {
                count,
                plus
            }
         },
     })
     app.mount("#app");