===========app.vue文件=============

<template>
  <div id="app">
      <router-view></router-view>
  </div>
</template>
<script>
export default {
  name: 'App',
  components: {
 
  },
  watch:{
  },
}
</script>
<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}
body{
margin:0px auto;
padding:0px;
width: 100%;
    height: 100%;
    /* position: fixed; */
    left: 0;
    z-index: 999;
    overflow:scroll
}
html, body{
  height: 100%;
  width: 100%;
}
html,body{
  height: 100%;
  background: #ececec;
}
html, body, ul, li, ol, dl, dd, dt, p, h1, h2, h3, h4, h5, h6, form, fieldset, legend, img { margin:0; padding:0; }
fieldset, c{ border:none; }
img{border: none;}
address, caption, cite, code, dfn, th, var { font-style:normal; font-weight:normal; }
ul, ol ,li{ list-style:none; }
a { color:#666; text-decoration:none; }
em{
  font-style: normal;
}
</style>
=========main.js文件==========
import Vue from 'vue'
import App from './App.vue'
import router from './router/router'  (安装路由)
Vue.config.productionTip = false
new Vue({
  router,
  render: h => h(App),
}).$mount('#app')
========copy.文件===========
copy.文件
<template>
  <div class="">
   新建了一个vue页面
  </div>
</template>
<script>
export default {
    name: "",
    components:{
    },
    data(){
      return{
      }
    },
    created:function(){
    },
    methods:{
    },
    mounted:function(){} 
}
</script>
<style lang='less' scoped>
</style>
==========router.js文件============
import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../pages/index.vue'
Vue.use(VueRouter)
const routes = [
    {
      path: '/',
      redirect: '/index'
    },
    {
      path: '/index',
      name: 'index',
      component: Index,
    },
]
const router = new VueRouter({
  mode: 'hash',
  routes
})
export default router
========vue.config.js文件=========
const webpack = require('webpack')
module.exports = {
  publicPath:'./',       // 根目录地址
  lintOnSave: false,
  configureWebpack: {
    plugins: [
        new webpack.ProvidePlugin({
            $:"jquery",
 
            jQuery:"jquery",
            "windows.jQuery":"jquery"      (安装jq后)
        })
    ],
  },
  css:{ sourceMap: true }//谷歌浏览器显示css行数
}
==========request.js文件 (安装axios后)==========
import axios from 'axios'
export function request(config) {
  const instance = axios.create({
    // baseURL: "http://192.168.x.x:8087",
  })
  instance.interceptors.request.use(config => {
    if(config.url ==='/api/upload'){
      config.headers['Content-Type'] = 'application/x-www-form-urlencoded'
    }
    return config
  }, error => {
    console.log(error)
  })
  instance.interceptors.response.use(res => {
    return res.data
  }, error => {
    console.log(error)
  })
  return instance(config)
}
===========请求方法:============
import {request} from "../request";
export function xxxx(obj) {
  return request({
    url:'/api/xxx/xxx',
    params:{
        'xx':obj.data,
        'xx':obj.id
    }
  })
}
 
 

vue-cli快速搭建项目的几个文件(一)的更多相关文章

  1. 基于Vue-cli 快速搭建项目

    Vue-cli可以快速帮助我们创建一个项目,这是官方给我们提供的脚手架.下面我说一下vue-cli的使用方法. 一.准备工作 在使用vue-cli时,首先需要安装nodejs,npm,其次需全局安装v ...

  2. vue-cli webpack 快速搭建项目

    一.安装vue npm install vue -g 二.用vue-cli快速搭建项目 //全局安装vue-cli npm install install -g vue-cli //创建一个基于web ...

  3. VUE CLI环境搭建文档

    VUE CLI环境搭建文档 1.安装Node.js 下载地址 https://nodejs.org/zh-cn/download/ 2.全局安装VUE CLI win+R键打开运行cmd窗口输入一下代 ...

  4. (转载) android快速搭建项目积累

    android快速搭建项目积累 2016-04-05 20:07 519人阅读 评论(0) 收藏 举报  分类: android优化(8)   Rx技术(5)  版权声明:本文为博主原创文章,未经博主 ...

  5. vue cli创建typescript项目

    使用最新的Vue CLI @vue/cli创建typescript项目,使用vue -V查看当前的vue cli版本 安装命令 npm install -g @vue-cli 创建项目 vue cre ...

  6. Vue CLI创建Vue2项目

    1.安装Node.js * Node.js中包含了npm工具 安装后查看版本: node -v npm -v 2.设置npm的源为国内源 npm config set registry https:/ ...

  7. vue cli3.0快速搭建项目详解(强烈推荐)

    这篇文章主要介绍下vue-cli3.0项目搭建,项目结构和配置等整理一下,分享给大家. 一.介绍 Vue CLI 是一个基于 Vue.js 进行快速开发的完整系统.有三个组件: CLI:@vue/cl ...

  8. vue cli4.0 快速搭建项目详解

    搭建项目之前,请确认好你自己已经安装过node, npm, vue cli.没安装的可以参考下面的链接安装. 如何安装node? 安装好node默认已经安装好npm了,所以不用单独安装了. 如何安装v ...

  9. 使用Vue CLI脚手架搭建vue项目

    本次是使用@vue/cli 3.11.0版本搭建的vue项目 1. 首先确保自己的电脑上的Node.js的版本是8.9版本或者以上 2. 全局安装vue/cli npm install @vue/cl ...

  10. 使用vue-cli(vue脚手架)快速搭建项目

    vue-cli 是一个官方发布 vue.js 项目脚手架,使用 vue-cli 可以快速创建 vue 项目.这篇文章将会从实操的角度,介绍整个搭建的过程. 1. 避坑前言 其实这次使用vue-cli的 ...

随机推荐

  1. 靶场搭建----phpstudy2018安装及注意问题

    安装 官网下载: https://www.xp.cn/download.html 新人推荐2018 版本phpstudy 介绍 系统服务------开机自启 非服务模式------开机不自启 搭建好环 ...

  2. verilog之预编译

    verilog之预编译 1.基本作用 预编译,就是在verilog进入编译器前的准备工作.一般是完成一些文件的调用,一些编译器的设置,一些参数的定义.一般使用include,define,timesc ...

  3. KingbaseES V8R6 集群运维案例 -- 磁盘空间问题导致集群故障

    某商业银行生产系统KingbaseES读写分离集群主库出现故障,导致集群主备发生切换.客户要求说明具体的原因. KingbaseES读写分离集群基本信息: KingbaseES集群信息   操作系统 ...

  4. KingbaseES V8R6集群运维案例之---sys_rewind应用分析

    ​ 案例说明: sys_rewind是用于在数据库cluster的时间线分叉以后,同步一个 KingbaseES 数据库cluster 和同一数据库cluster另一份拷贝的工具.一种典型的场景是在失 ...

  5. KingbaseES 判断字符串包含的几种方法

    判断字符串包含的几种方法: 1. position test=# select position('aa' in 'abcd'); position ---------- 0 (1 行记录) test ...

  6. CSS---RGBA和position属性解释

    rgb与rgba的含义 RGB 是代表Red(红色) .Green(绿色). Blue(蓝色)三个单词的缩写. RGBA 颜色值是 RGB 颜色值的扩展,添加了一个 alpha 通道, 它规定了对象的 ...

  7. 成长计划知识赋能 | 第九期:渐进式深入理解OpenHarmony系统

      成长计划知识赋能直播第九期如约而至,面向OpenHarmony初中级开发者,解析OpenHarmony系统架构和驱动框架,助力开发者快速上手OpenHarmony系统开发. 详情见海报内容,资深软 ...

  8. [IOI2000]邮局 题解

    简要题意 线段上有 \(V\) 个村庄,现在要建 \(P\) 个邮局,使每个村庄到最近的邮局的距离之和最小. 50分做法 设\(dp[i][j]\) 表示第一个村庄到第 \(i\) 个村庄,建了 \( ...

  9. HMS Core Discovery第15期直播预告|构筑立体世界,共造沉浸式营销

    [导读] AR技术,是一种将真实世界信息和虚拟世界信息"无缝"衔接的技术,现如今AR技术受到日益广泛的关注,在我们生活中发挥着重要的作用,并显示出巨大的潜力--它是如何改变我们观察 ...

  10. C++调用Python-4:调用Python函数,传参数字

    # mytest.py def myadd(a, b): print("this is test python print add function") return a+b #i ...