当前位置: 移动技术网 > IT编程>开发语言>JavaScript > vue项目步骤

vue项目步骤

2020年07月08日  | 移动技术网IT编程  | 我要评论

一、vue

过滤器
组件,组件拆分

二、vue-cli

  • 安装
  • vue.config.js chainWebpack(config.resolve.alias.set()) //改写成绝对路径
module.exports = {
  chainWebpack: config => {
    config.resolve.alias
      .set('@', path.resolve(__dirname, './src/components'))
      .set('assets', path.resolve(__dirname, './src/assets'))
      .set('views', path.resolve(__dirname, './src/views'))
  },
}

devServer(proxy)// 配置代理

module.exports = {
  devServer: {
    proxy: {
      '/api': {
        target: 'http://localhost:9000',
        changeOrigin: true
      }
    }
  }
}
  • babel-import-plugin babel.config.js
module.exports = {
  presets: [
    '@vue/cli-plugin-babel/preset'
  ],
  plugins: [
    ['import', {
      libraryName: 'vant',
      libraryDirectory: 'es',
      style: true
    }, 'vant']
  ]
}

三、vant

按需引入

tabbar

四、工具

1、json-server

  • json-server ./mock/mock.js -r ./mock/routes.json -p 9000 -w

2、axios

本文地址:https://blog.csdn.net/weixin_44656392/article/details/107173035

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网