本文介绍了vue引入swiper插件,分享给大家,希望对大家有帮助
步骤一:
安装vue,步骤二:
创建vue项目上面这些就是安装好vue项目,最主要的就是下面的步骤
步骤三:
下载好swiper相关的js和css,js放在static目录下,css放在assets目录下。步骤四:
安装runtime:
终端命令:npm install babel-runtime
步骤五:
module.exports = {
root: true,parser: 'babel-eslint',parserOptions: {
sourceType: 'module'
},env: {
browser: true,},// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
extends: 'standard',// required to lint *.vue files
plugins: [
'html'
],// add your custom rules here
'rules': {
// allow paren-less arrow functions
'arrow-parens': 0,// allow async-await
'generator-star-spacing': 0,// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
},'globals': {
"Swiper": true
} //这个地方是新加入的 全局注入
}
root: true,parser: 'babel-eslint',parserOptions: {
sourceType: 'module'
},env: {
browser: true,},// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
extends: 'standard',// required to lint *.vue files
plugins: [
'html'
],// add your custom rules here
'rules': {
// allow paren-less arrow functions
'arrow-parens': 0,// allow async-await
'generator-star-spacing': 0,// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
},'globals': {
"Swiper": true
} //这个地方是新加入的 全局注入
}