我的 html 中有这个:
<script type="text/javascript">
less = {
env: "development", // or "production"
async: false, // load imports async
fileAsync: false, // load imports async when in a page under
// a file protocol
poll: 1000, // when in watch mode, time in ms between polls
functions: {
returnCenter: function (value, context) {
return 'center';
}
}, // user functions, keyed by name
dumpLineNumbers: "comments", // or "mediaQuery" or "all"
relativeUrls: false,// whether to adjust url's to be relative
// if false, url's are already relative to the
// entry less file
rootpath: ":/a.com/"// a path to add on to the start of every url
//resource
};
</script>
<script src="less.js" type="text/javascript"></script>
那么在函数中,如何在我的less文件中创建和使用函数呢?
谢谢,祝你好运!
PD 这个returnCenter,不起作用。带或不带参数。