【问题标题】:How to setup Constructor options in Buefy while using CDN?使用 CDN 时如何在 Buefy 中设置构造函数选项?
【发布时间】:2022-12-13 03:49:02
【问题描述】:

我是 Buefy 和 Vue 的新手。

我通过 CDN 使用以下库:bulma0.9.3 vue2.6.14 buefy0.9.13 fontawesome5.15.4

正在使用两个文件 index.htmlindex.js

我尝试按照Constructor options - Buefy documentation 给出的说明将defaultIconPack 全局设置为fontawesome。但是index.html中的图标默认为mdi而不是fontawesome。

索引.js

Vue.use(Buefy, {
        defaultIconPack: 'fas'
    });
let vm = new Vue({
    el: "#app",
    delimiters: ["[[", "]]"],
    data: {
        data: [],
        columns: []
    },
    mounted: function () {
        document.getElementById('main').classList.add('is-active');
    },
    methods: {},
    computed: {}
})

请指教。

【问题讨论】:

    标签: vue.js font-awesome-5 buefy


    【解决方案1】:

    尝试使用 this.$buefy.config,如下所示:

    mounted:function () {
        $buefy.config.setOptions({defaultIconPack: 'fas'});
        document.getElementById('main').classList.add('is-active');
    }, 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-11
      • 1970-01-01
      • 1970-01-01
      • 2019-03-27
      • 2010-10-09
      相关资源
      最近更新 更多