Comments (7)
类型是可以通过 ts 类型合并实现自定义:
declare module '@fower/atomic-props' {
export interface AtomicProps {
customProp?: string
}
}
没理解 【是不是可以把生成types放在用户端, 可以根据不同的config生成不同的类型定义文件】这是什么意思
from fower.
合并类型只能增加, 不能减少, 如果color只定义了两个, 比如500和600, 还是会得到所有内置color的提示
from fower.
没理解 【是不是可以把生成types放在用户端, 可以根据不同的config生成不同的类型定义文件】这是什么意思
就是可以读取用户的config, 然后动态生成类型定义文件, 可以办到吗
from fower.
fower 暂时没配置文件,配置通过 setConfig
实现,暂时不想引进配置文件的概念,因为那需要约定文件名和路径
from fower.
我说的就是setConfig
, 不知道是否可以在setConfig
里面加个generateTypes
的钩子
from fower.
这个也许可以,不过 setConfig
是项目运行时,不是 build 运行时,可能不好搞
from fower.
我想到的是用一个单独的包来实现生成逻辑, setConfig
里可以判断环境变量和包是否存在来开关生成的逻辑.
当然这个包可以不依赖setConfig
, 比如cli执行读取某个config文件, 生成类型
from fower.
Related Issues (20)
- expo 工程引入 报错 HOT 4
- 希望可以支持vue3.x (Hope to Support Vue 3.x ) HOT 12
- Taro中产生大量内联样式 HOT 4
- 嵌套样式冲突 HOT 1
- 允许自定义 css 属性的名称 HOT 8
- @fower/taro的 Switch 组件 color样式在微信小程序无法覆盖 HOT 3
- [BUG] Taro-H5无法使用Fower HOT 1
- Taro H5 shadow原子不生效 HOT 4
- Taro H5 单位转换不正确
- Svelte Rollup waiting for changes forever HOT 1
- SvelteKit: any support for svelte kit? HOT 2
- Remax: @fower/remax的ts类型问题 HOT 3
- Taro中Space Between失效 HOT 3
- uniapp 打包app时会出现错误
- remax中的 web 模式p-10 w-160无效,微信小程序测试有效!
- 小程序中,有什么办法可以使用熟悉的px大小来开发吗? HOT 1
- 文档错别字 HOT 1
- 文档怎么没有中文了? HOT 2
- React Native flexWrap is not work
- setTheme自定义主题色
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 fower.