Created
September 21, 2017 23:01
-
-
Save lazyTai/0b0a88541cfe5db4bbb58ce4fca20ec3 to your computer and use it in GitHub Desktop.
cssString+template==>with todo cssString use in react
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Title</title> | |
<script src="https://cdn.bootcss.com/underscore.js/1.8.3/underscore-min.js"></script> | |
<script src="bundle.js"></script> | |
</head> | |
<body> | |
<script> | |
var str=` | |
div { | |
position: relative; | |
width:"{{width}}"; | |
height:"{{height}}"; | |
}` | |
_.templateSettings = { | |
interpolate: /\{\{(.+?)\}\}/g | |
}; | |
var after=_.template(str)({width:"100px",height:"111px"}) | |
console.log(after) | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment