rax icon indicating copy to clipboard operation
rax copied to clipboard

feat: support customize styles and scripts

Open fengzilong opened this issue 4 years ago • 3 comments

比如在我们的使用场景中

  1. 需要给资源追加一些参数 ?xxx=yyy
  2. 改写 script 的执行逻辑,不会立马执行,等收到客户端消息再去执行主脚本
  3. 使用 <link rel="preload"> 等其他标签处理 styles/scripts

该 PR 支持了自定义 styles 和 scripts 处理逻辑,用法如下

import { Style, Script } from 'rax-document'

// for customize styles
<Style>
  {
	styles => {
	  // do something with styles
  	}
  }
</Style>

// for customize scripts
<Script>
  {
	scripts => {
	  // do something with scripts
  	}
  }
</Script>

fengzilong avatar Aug 31 '21 04:08 fengzilong

更新下版本和 changelog

SoloJiang avatar Oct 09 '21 08:10 SoloJiang

更新下版本和 changelog

done

fengzilong avatar Oct 09 '21 11:10 fengzilong

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jan 10 '22 02:01 CLAassistant