Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.4k views
in Technique[技术] by (71.8m points)

小程序带参公共模板

问题描述:
我有一堆代码很多个小程序都需要使用,里面回引入一些js,这个js也比较多,除了公用的这一块要用,每个小程序的其他地方也可能要用且都已经写好了,改起来有点多,所以这写js没有放进这一坨公用代码里面,想实现别个来拉取这些公用代码时,直接传入一个路径,公用代码里面根据传入的路劲去引入js


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

可以写个生成代码的脚本去生成公用代码,把js路径写成配置。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...