Skip to content

Migrate from Vue

ElfUI retains a lot of the template mentality familiar to Vue users, but the component model and runtime are different.

VueElfUI
SFCCommon .ts/.tsx macro component
ref()useRef()
reactive()useReactive()
computed()useComputed()
emit()defineEmits()
defineModel()defineModel()
Vue ComponentCustom Element

state

ts
const count = useRef(0);
count.set(count.peek() + 1);

Object:

ts
const user = useReactive({ name: "Elf" });
user.name = "ElfUI";

Component output

The ElfUI component is a native tag after registration:

html
<elf-counter></elf-counter>

This allows it to be used by Vue, React, Angular or plain HTML.