nodejs获取到字符串如下:
<template>
<div class="hello" @click="handleClick">
Hello!
</div>
</template>
<script setup>
const handleClick = () => {
console.lot('handleClick')
}
</script>
<style>
.hello{ color: red }
</style>
将以上代码编译成一个js对象。可以直接在动态组件中使用。
vue build component.vue -t lib