We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ts下的代码 lf.extension.control.addItem({ key: 'selection', iconClass: 'selection-icon', title: '', text: '选区', onClick: (lf: LogicFlow) => { lf.openSelectionSelect() lf.once('selection:selected', () => { lf.closeSelectionSelect() }) } })
打包时报错信息 类型“ExtensionDefinition | Extension”上不存在属性“addItem”。
代码包文件位置src\page\home\home.vue
代码.zip
2.0.10
2.0.14
No response
The text was updated successfully, but these errors were encountered:
// 导入 Control,类型定义的时候会用到 import { Control } from '@logicflow/extension'; // 补充类型定义,这样打包的时候就不会报错 const control = lf.extension.control as Control; control.addItem({ key: 'selection', iconClass: 'selection-icon', title: '', text: '选区', onClick: (lf: LogicFlow) => { lf.openSelectionSelect() lf.once('selection:selected', () => { lf.closeSelectionSelect() }) } });
// 确定代码没问题,只是类型检查报错,可以直接添加下面这一行来忽略某一行代码中的ts类型错误 // @ts-ignore lf.extension.control.addItem({ key: 'selection', iconClass: 'selection-icon', title: '', text: '选区', onClick: (lf: LogicFlow) => { lf.openSelectionSelect() lf.once('selection:selected', () => { lf.closeSelectionSelect() }) } });
Sorry, something went wrong.
No branches or pull requests
发生了什么?
ts下的代码
lf.extension.control.addItem({
key: 'selection',
iconClass: 'selection-icon',
title: '',
text: '选区',
onClick: (lf: LogicFlow) => {
lf.openSelectionSelect()
lf.once('selection:selected', () => {
lf.closeSelectionSelect()
})
}
})
打包时报错信息
类型“ExtensionDefinition | Extension”上不存在属性“addItem”。
代码包文件位置src\page\home\home.vue
代码.zip
logicflow/core版本
2.0.10
logicflow/extension版本
2.0.14
logicflow/engine版本
No response
浏览器&环境
No response
The text was updated successfully, but these errors were encountered: