Comments (3)
早期就是下面这样的写法,当时处理按需加载的时候发现由于导出的 Button 变量都指向了同一个引用也就是 Button.tsx
从而跳过 button/index.ts
的导入直接进入 button/Button.tsx
的编译,丢失了 style
的样式文件,中间重新赋值给了 _Button
变量就可以避免指向同一个引用保留住了 style
样式文件
from tdesign-react.
早期就是下面这样的写法,当时处理按需加载的时候发现由于导出的 Button 变量都指向了同一个引用也就是
Button.tsx
从而跳过button/index.ts
的导入直接进入button/Button.tsx
的编译,丢失了style
的样式文件,中间重新赋值给了_Button
变量就可以避免指向同一个引用保留住了style
样式文件
原来如此,没注意你们在这个组件入口的地方引入样式文件,一般样式在组件本身(Button.tsx)里引入,可能和你们采用的 CSS 方案有关吧。
from tdesign-react.
早期就是下面这样的写法,当时处理按需加载的时候发现由于导出的 Button 变量都指向了同一个引用也就是
Button.tsx
从而跳过button/index.ts
的导入直接进入button/Button.tsx
的编译,丢失了style
的样式文件,中间重新赋值给了_Button
变量就可以避免指向同一个引用保留住了style
样式文件原来如此,没注意你们在这个组件入口的地方引入样式文件,一般样式在组件本身(Button.tsx)里引入,可能和你们采用的 CSS 方案有关吧。
你说的在组件本身(Button.tsx) 里引入也是一个方案,那样的话确实也能保留住样式文件,不过感觉管理起来可能会比较混乱,不同组件有不同的叫法(Button.tsx、Input.tsx...),有的组件还需要嵌套其他子组件就需要引入对应文件夹下的 tsx 文件,文件层级跟代码约束比较多,统一在 index.ts 文件里处理看起来也比较规范一些
from tdesign-react.
Related Issues (20)
- [Form] 表单首次通过 hook 调用 setFieldsValue 设置值不会触发 onValuesChange HOT 2
- [Cascader] Cascader 组件同时开启 checkStrictly & filterable props,在筛选结果的浮层无法正确选中筛选项 HOT 7
- [TreeSelect] input在focus时支持显示自定义的valueDisplay HOT 5
- [Dropdown] 支持多层菜单自动翻转 HOT 2
- [cascader] : value值需要唯一的(也就是Key唯一) HOT 4
- [Pagination] 国际化文本“跳至” 翻译希望能从“jump to”调整为“Jump to” HOT 4
- [Input] 希望加入minLength HOT 2
- [Cascader] filter 添加 debounce 无效, Selector 和 Cascader 默认 filterable 大小写敏感策略不一致 HOT 3
- [Table] 自定义配置列弹窗显示问题 HOT 2
- [Table] 修改table的td固定行高不生效 HOT 4
- [ColorPicker] 描述问题的标题 HOT 2
- [Select] 多选下拉选中滚动的问题 HOT 4
- [Table] 可编辑行的表格校验规则回调期望添加行信息,以便联动校验 HOT 2
- [Cascader] 设置clearable后,点击清除或多次触发onChange事件,并且返回值格式不一致 HOT 5
- [Row] use getCssVarsValue function, and comparing sizes with units HOT 1
- [Cascader] 级联组件,option 一级的value和二级的value 相同时,此时判断选中逻辑异常 HOT 3
- [Tree] 希望树节点可以控制异步加载load方法的触发时机 HOT 2
- 图标显示异常被放大 HOT 8
- [Dialog] useDialogPosition 绑定了 getClickPosition,多次渲染没有清除,导致性能下降 HOT 3
- [FormList ] FormList 嵌套 FormList 的时候,会导致死循环 HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tdesign-react.