naive-ui/playground/ssr/app.js
2021-06-02 14:37:37 +08:00

31 lines
522 B
JavaScript

import { h, defineComponent, ref } from 'vue'
import { NButton, NSsrProvider } from 'naive-ui'
const App = defineComponent({
setup () {
return {
count: ref(0)
}
},
render () {
return h(
NSsrProvider,
{
ssr: typeof window === 'undefined'
},
{
default: () =>
h(
NButton,
{
onClick: () => this.count++
},
{ default: () => this.count }
)
}
)
}
})
export default App