簡體   English   中英

如何將新字體真棒圖標添加到我的 odoo 模塊?

[英]how to add new font awesome icon to my odoo module?

我正在定制 web_notify oca 模塊,它向屏幕發送彈出通知,它包含一些通知的變體,每個都有一個字體真棒圖標出現在它定義這個 js 文件中的圖標的通知上

odoo.define('web_notify.Notification', function (require) {
"use strict";

var Notification = require('web.Notification');

Notification.include({
    icon_mapping: {
        'success': 'fa-thumbs-up',
        'danger': 'fa-exclamation-triangle',
        'warning': 'fa-exclamation',
        'info': 'fa-info',
        'default': 'fa-lightbulb-o',
    },
    init: function () {
        this._super.apply(this, arguments);
        // Delete default classes
        this.className = this.className.replace(' o_error', '');
        // Add custom icon and custom class
        this.icon = (this.type in this.icon_mapping) ?
            this.icon_mapping[this.type] :
            this.icon_mapping['default'];
        this.className += ' o_' + this.type;
    },
});

}); 

我在很棒的網站上搜索,我需要添加一個我發現它的圖標聲明

  <i class="fas fa-mosque">
  </i>

說如果我需要用新的替換 fa-thumbs-up 我該怎么做

您是否包含了 font awesome 的最新樣式表鏈接?它似乎在這里工作正常。

 <html> <head> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css"> </head> <body> <i class="fas fa-mosque"> </i> <body> </html>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM