按照参考文档操作即可
参考文档:
uni-icons图标
字体图标
【uni-app怎么引用使用阿里巴巴矢量图标库iconfont】
注册登录
- 选icon入购物车
- 加入项目
- 下载至本地
如果图片数量多,使用如下操作批量加入购物车
参考回复:
https://www.iconfont.cn/collections/detail?spm=a313x.7781069.1998910419.d9df05512&cid=7077
在图标选择界面斜体样式打开浏览器的控制台 ctrl+shift+i
- 方法一:
// 1.控制台粘贴回车
var j=document.createElement('script');
j.setAttribute("src", 'https://ajax.microsoft.com/ajax/jquery/jquery-1.4.min.js');
document.getElementsByTagName("head")[0].appendChild(j);
// 2.控制台粘贴回车
$("span[title='添加入库']").each(function(){
$(this).delay(500).click();
console.log($(this).parent().prev().children().eq(0).html());
});
- 方法二:
// ES6就好了,不用拉个JQ库
document.querySelectorAll("span[title='添加入库']").forEach((o)=>{setTimeout(()=>{o.click();console.log(o.parentNode.parentNode.querySelector('.icon-name').innerText)},500)})
注意nvue不能使用css引入字体文件
nvue
中不可直接使用 css 的方式引入字体文件,需要使用以下方式在 js 内引入。
注意,不是不可引入css,是不可在css中引入字体文件
var domModule = weex.requireModule('dom');
domModule.addRule('fontFace', {
fontFamily: 'fontFamilyName',
src: "url('https://...')",
});