ant-design/antd-mobile-samples

rn-custom-ui项目中主题更改不起作用

Open

#62 创建于 2018年6月7日

在 GitHub 查看
 (4 评论) (0 反应) (0 负责人)HTML (1,134 star) (1,109 fork)batch import
React Nativehelp wanted

描述

克隆的是antd-mobile-samples直接运行的,运行后不起作用 image

- antd-mobile 版本:
	"dependencies": {
		"antd-mobile-rn": "next",
		"react": "^15.6.1",
		"react-native": "0.41.2"
	},

还有如下代码:

const path = require('path');
const fs = require('fs');

const defaultVars = require('antd-mobile-rn/lib/style/themes/default.native');
const customVars = require('../theme');
const themePath = path.resolve(require.resolve('antd-mobile-rn'), '../style/themes/default.native.js');

const themeVars = Object.assign({}, defaultVars, customVars);

if (fs.statSync(themePath).isFile()) {
  fs.writeFileSync(
    themePath,
    'var brandPrimary = "#108ee9"; var brandPrimaryTap = "#1284d6";module.exports = ' + JSON.stringify(themeVars)
  );
}

请问是不是还需要在其他地方进行配置?这种修改代码样式的原理是什么呢

贡献者指南