ant-design/antd-mobile-samples

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

開放

#62 建立於 2018年6月7日

 (4 則留言) (0 個反應) (0 位負責人)HTML (1,109 個分叉)batch import
React Nativehelp wanted

倉庫指標

星標
 (1,134 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

克隆的是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)
  );
}

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

貢獻者指南