代码之家  ›  专栏  ›  技术社区  ›  James A Mohler Nika

图标在表列中停止工作

  •  0
  • James A Mohler Nika  · 技术社区  · 6 年前

    奇怪的事情发生在我的图标上

        <b-table :data="myDir">
            <template slot-scope="props">
                <b-table-column>
                    {{ props.row.icon }} <!-- Correct -->
                    <i class="fas" :class="'fa-' + props.row.icon"></i> <!-- Wrong -->
                    <b-icon :pack="props.row.iconPack" :icon="props.row.icon" :type="props.row.iconType"></b-icon>  <!-- Wrong -->
                </b-table-column>
    

    enter image description here

    myDir通过

            watch: {
                path: function () {
                    this.getDir();
                }
            },
    
            mounted () {
                this.getDir();
            },
    
            methods: {
                getDir : function() {
                    console.log("Loading " + this.path);
                    axios
                        .get('?path=' + this.path + '&format=json')
                        .then(response => (this.myDir = response.data))
                        .catch(error => {
                            console.log(error)
                            });
                }
            }
    
    1 回复  |  直到 6 年前
        1
  •  0
  •   James A Mohler Nika    6 年前

    我不知道为什么这样行,但确实行

    我使用的是fontsawesome的JavaScript版本。

    <script defer src="https://use.fontawesome.com/releases/v5.3.1/js/all.js"></script>
    

    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" crossorigin="anonymous">