mirror of
https://github.com/pengzhanbo/vuepress-theme-plume.git
synced 2026-04-23 10:58:13 +08:00
19 lines
405 B
TypeScript
19 lines
405 B
TypeScript
import { defineComponent, h, ref } from 'vue'
|
|
import styles from './Counter.module.css'
|
|
|
|
export default defineComponent({
|
|
setup() {
|
|
const count = ref(0)
|
|
return () => h('div', {
|
|
class: 'counter',
|
|
}, [
|
|
h('p', `Counter: ${count.value}`),
|
|
h('button', {
|
|
type: 'button',
|
|
class: styles.btn,
|
|
onClick: () => count.value += 1,
|
|
}, '+ 1'),
|
|
])
|
|
},
|
|
})
|