eightHundreds

Results 77 comments of eightHundreds

> Btw. I implemented a png editor for draw.io using the proposed VS Code APIs. You can find the source code [here](https://github.com/hediet/vscode-drawio/blob/master/src/DrawioEditorProvider.ts). vscode extension marketplace not allow publishing extensions that...

``` ``` > > @sisterAn 规范里好像没提到 await 内部实现了 generator, 如果从 polyfill 中的实现去断定 await 内部就是 generator……这样好像有点不严谨…… > > 另外 `await` 的例子其实可以转换为 > > ```js > > var a = 0 >...

今天又遇到了一个case. 一个插槽组件(接收props.children的组件),组件内部的逻辑是,当children没传时给一个默认组件。 现在由于这个默认传children问题,组件默认变成了 ![图片](https://user-images.githubusercontent.com/18695431/195086020-e040bc29-e444-424e-87cf-3d1cefc90d95.png) 因为children为null ![图片](https://user-images.githubusercontent.com/18695431/195086092-e8da7587-c75a-4f02-9020-7ed92944c783.png)

第三个Case, 跟children有关 ``` JSX // 根据选中tab展示不同内容 ``` 希望只使用tab切换功能, 不使用TabPane做容器。 但是在画布中却强制显示出TabPane的插槽 ![image](https://user-images.githubusercontent.com/18695431/198921359-80a3ddc0-4e7b-4391-8822-5b689e2b2a56.png)

抛开这个issue. 翻源码时, 发现一个地方,可能有问题 ``` props: this.document.designer.transformProps(props, this, stage), ...this.document.designer.transformProps(_extras_, this, stage), ``` transformProps方法最后会调用addPropsTransducer. 这个地方调用了两次addPropsTransducer, 我猜测第二次是处理内部props时调用的, 但是addPropsTransducer的使用方无法区分当前处理的是组件本身的props还是低代码引擎内部的props

> 这个设置了默认值 schema 就会生成,除非你自己过滤一下,参考 project.addPropsTransducer 这个 API。 我最终的做法 ``` ts ctx.project.addPropsTransducer((props, node, ctx) => { const propsWithDefaultValue = getPropsWithDefaultValue(node.componentMeta); Object.keys(props).forEach((key) => { if (key in propsWithDefaultValue && propsWithDefaultValue[key] === props[key])...

https://github.com/alibaba/lowcode-plugins/blob/6d9681da088b877ddc02bf95fd7de86a5ea9b943/packages/plugin-components-pane/src/index.tsx#L71 ``` const keyToSearch = `${strTitle}#${strComponentName}#${strDescription}#${strKeywords}`.toLowerCase(); ``` 我要搜的是snippets的title(组件面板里每个item都是一个snippet,不是组件), 不是组件. 源码上看, 被搜索的内容是组件自己的信息