vue項目中插件的引入

方法一:javascript

        1,先在主入口頁面index.html中用script標籤引入html

<script src="./static/jquery-1.12.4.js"></script>

        2,在vue.config.js配置文件裏配置一個externalsvue

module.exports = {
    configureWebpack: {
        externals: {
            'jquery': 'jquery',
        }
    }
};

       3,在組件中引用jqueryjava

import $ from 'jquery'

方法二:jquery

相關文章
相關標籤/搜索