更新组件,兼容MES PullRequest #924
This commit is contained in:
35
README.md
35
README.md
@@ -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, "插槽内容"); // 并不会报错
|
||||
```
|
||||
|
Reference in New Issue
Block a user