TDesign主题配置生成器挂件
npm install @tdesign/theme-generatorEnglish | 简体中文
TDesign theme generator plugin, which is tailored for the component library documentation site. It is used for real-time preview of color and style adjustments.
1. npm i @tdesign/theme-generator
2. import '@tdesign/theme-generator';
3. add in the application code
- For mobile and mini-program platforms, you need to add the device parameter, such as .
- If you encounter issues where parameters cannot be passed correctly, you can try the following method to introduce the component:
``js`
const generator = document.createElement('td-theme-generator');
generator.setAttribute('device', 'mobile');
document.body.appendChild(generator);
`bash``
npm link
npm run build:watch # open the component library site with hot-reload preview