<div id="app">
<button type="button" @click="count++">
Count is: {{ count }}
</button>
<hr/>
<button type="button" @click="sayHi">打招呼</button>
</div>
const { createApp, ref } = Vue;
const app = createApp({
setup() {
const count = ref(0);
const sayHi = () => {
window.alert('Hello Ray.');
};
return {
count,
sayHi
}
},
});
app.mount('#app');
This Pen doesn't use any external CSS resources.