vue-cli3.0踩坑

eslint.js文件配置
module.exports = {
root: true,
env: {
node: true,
jquery:true
},
‘extends’: [
‘plugin:vue/essential’,
‘@vue/standard’
],
rules: {
‘no-console’: process.env.NODE_ENV === ‘production’ ? ‘error’ : ‘off’,
‘no-debugger’: process.env.NODE_ENV === ‘production’ ? ‘error’ : ‘off’,
‘semi’: 0,//分号检查
‘quotes’: [0, ‘double’],
‘eol-last’: 0,
‘indent’: ‘off’,
‘no-unused-vars’: ‘off’
},
parserOptions: {
parser: ‘babel-eslint’
}
}

gitignore文件的配置

.DS_Store
node_modules
/dist

local env files

.env.local
.env.*.local

Log files

npm-debug.log*
yarn-debug.log*
yarn-error.log*

Editor directories and files

.idea
.vscode
.git
*.suo
.ntvs
*.njsproj
*.sln
*.sw?

package.json管理依赖包的版本号,本次注重整合bootstrap3.3.7及jquery

{
“name”: “vue-marrylived”,
“version”: “0.1.0”,
“private”: true,
“scripts”: {
“serve”: “vue-cli-service serve”,
“build”: “vue-cli-service build”,
“lint”: “vue-cli-service lint”,
“report”: “vue-cli-service build --report”
},
“dependencies”: {
“axios”: “^0.19.0”,
“babel-runtime”: “^6.26.0”,
“core-js”: “^3.3.2”,
“jquery”: “^3.3.1”,
“bootstrap”: “^3.3.7”,
“vue”: “^2.6.10”,
“vue-router”: “^3.1.3”,
“vuex”: “^3.0.1”
},
“devDependencies”: {
“@vue/cli-plugin-babel”: “^4.0.0”,
“@vue/cli-plugin-eslint”: “^4.0.0”,
“@vue/cli-service”: “^4.0.0”,
“@vue/eslint-config-standard”: “^4.0.0”,
“babel-eslint”: “^10.0.3”,
“eslint”: “^5.16.0”,
“eslint-plugin-vue”: “^5.0.0”,
“stylus”: “^0.54.7”,
“stylus-loader”: “^3.0.2”,
“vue-template-compiler”: “^2.6.10”
}
}

新增vue.config.js文件因为3.0没有

/*
*Vue-CLI项目的核心配置文件
*/
const webpack = require(“webpack”);

module.exports = {
configureWebpack: {
plugins: [
new webpack.ProvidePlugin({
$: “jquery”,
jQuery: “jquery”,
“window.jQuery”: “jquery”,
Popper: [“popper.js”, “default”]
})
]
}
};

如果有需要main.js 文件内容

import Vue from ‘vue’
import App from ‘./App.vue’
import router from ‘./router’
import store from ‘./store’
// 导入bootstrap
import “bootstrap”
import “bootstrap/dist/css/bootstrap.css”

Vue.config.productionTip = false

new Vue({
router,
store,
render: h => h(App)
}).$mount(’#app’)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值