更新组件,兼容MES PullRequest #924

This commit is contained in:
2025-04-29 15:58:53 +08:00
parent fa8b468c32
commit 18582016b2
11 changed files with 204 additions and 88 deletions

View File

@@ -45,4 +45,37 @@
## 注意事项
1. 主项目和子项目需要同源或是配置好了CORS策略
2. 该库对Vue2.7的支持有限
2. 该库对Vue2.7的支持有限
3. 使用引入模块的方式渲染带有插槽的组件会导致错误,原因未知:
组件`JumpBtn.vue`
```vue
<template>
<div>
<button @click="HandleClick">
<slot></slot>
</button>
</div>
</template>
```
渲染函数
```ts
import JumpBtn from './JumpBtn.vue';
hh(JumpBtn, null, "插槽内容"); // 会导致错误
```
若注册为全局组件并在调用渲染函数时使用组件标签名,则不会错误
`main.ts`
```ts
import JumpBtn from './JumpBtn.vue';
app.component('jump-btn', JumpBtn);
```
渲染函数
```ts
h('jump-btn', null, "插槽内容"); // 并不会报错
```