luffy前台必备,请注意查收^ _ ^

axios前后台交互

安装:前端项目目录下的终端

>: cnpm install axios

配置:main.js

import axios from 'axios'
Vue.prototype.$axios = axios;

cokies操作

安装:前端项目目录下的终端

>: cnpm install vue-cookies

配置:main.js

import cookies from 'vue-cookies'
Vue.prototype.$cookies = cookies;

element-ui页面组件框架

安装:前端项目目录下的终端

>: cnpm install element-ui

配置:main.js

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);

bootstrap页面组件框架

安装:前端项目目录下的终端

>: cnpm install jquery
>: cnpm install bootstrap@3

配置jquery:vue.config.js

const webpack = require("webpack");

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

配置bootstrap:main.js

import 'bootstrap'
import 'bootstrap/dist/css/bootstrap.min.css'

前端主页

图片准备

将提供的资料中的图片移植到项目的img文件夹下

页头组件:components/Header.vue

<template>
<div class="header-box">
<div class="header">
<div class="content">
<div class="logo full-left">
<router-link to="/"><img @click="jump('/')" src="@/assets/img/logo.svg" alt=""></router-link>
</div>
<ul class="nav full-left">
<li><span @click="jump('/course')" :class="this_nav=='/course'?'this':''">免费课</span></li>
<li><span @click="jump('/light-course')" :class="this_nav=='/light-course'?'this':''">轻课</span></li>
<li><span>学位课</span></li>
<li><span>题库</span></li>
<li><span>老男孩教育</span></li>
</ul>
<div class="login-bar full-right">
<div class="shop-cart full-left">
<img src="@/assets/img/cart.svg" alt="">
<span><router-link to="/cart">购物车</router-link></span>
</div>
<div class="login-box full-left">
<span>登录</span>
&nbsp;|&nbsp;
<span>注册</span>
</div>
</div>
</div>
</div>
</div>
</template> <script>
export default {
name: "Header",
data() {
return {
this_nav: "",
}
},
created() {
this.this_nav = localStorage.this_nav;
},
methods: {
jump(location) {
localStorage.this_nav = location;
// vue-router除了提供router-link标签跳转页面以外,还提供了js跳转的方式
this.$router.push(location);
}
}
}
</script> <style scoped>
.header-box {
height: 80px;
} .header {
width: 100%;
height: 80px;
box-shadow: 0 0.5px 0.5px 0 #c9c9c9;
position: fixed;
top: 0;
left: 0;
right: 0;
margin: auto;
z-index: 99;
background: #fff;
} .header .content {
max-width: 1200px;
width: 100%;
margin: 0 auto;
} .header .content .logo {
height: 80px;
line-height: 80px;
margin-right: 50px;
cursor: pointer;
} .header .content .logo img {
vertical-align: middle;
} .header .nav li {
float: left;
height: 80px;
line-height: 80px;
margin-right: 30px;
font-size: 16px;
color: #4a4a4a;
cursor: pointer;
} .header .nav li span {
padding-bottom: 16px;
padding-left: 5px;
padding-right: 5px;
} .header .nav li span a {
display: inline-block;
} .header .nav li .this {
color: #4a4a4a;
border-bottom: 4px solid #ffc210;
} .header .nav li:hover span {
color: #000;
} .header .login-bar {
height: 80px;
} .header .login-bar .shop-cart {
margin-right: 20px;
border-radius: 17px;
background: #f7f7f7;
cursor: pointer;
font-size: 14px;
height: 28px;
width: 88px;
margin-top: 30px;
line-height: 32px;
text-align: center;
} .header .login-bar .shop-cart:hover {
background: #f0f0f0;
} .header .login-bar .shop-cart img {
width: 15px;
margin-right: 4px;
margin-left: 6px;
} .header .login-bar .shop-cart span {
margin-right: 6px;
} .header .login-bar .login-box {
margin-top: 33px;
} .header .login-bar .login-box span {
color: #4a4a4a;
cursor: pointer;
} .header .login-bar .login-box span:hover {
color: #000000;
} .full-left {
float: left !important;
} .full-right {
float: right !important;
} .el-carousel__arrow {
width: 120px;
height: 120px;
} .el-checkbox__input.is-checked .el-checkbox__inner,
.el-checkbox__input.is-indeterminate .el-checkbox__inner {
background: #ffc210;
border-color: #ffc210;
border: none;
} .el-checkbox__inner:hover {
border-color: #9b9b9b;
} .el-checkbox__inner {
width: 16px;
height: 16px;
border: 1px solid #9b9b9b;
border-radius: 0;
} .el-checkbox__inner::after {
height: 9px;
width: 5px;
}
</style>

轮播图组件:components/Banner.vue

<template>
<el-carousel height="520px" :interval="3000" arrow="always">
<el-carousel-item>
<img src="@/assets/img/banner1.png" alt="">
</el-carousel-item>
<el-carousel-item>
<img src="@/assets/img/banner2.png" alt="">
</el-carousel-item>
<el-carousel-item>
<img src="@/assets/img/banner3.png" alt="">
</el-carousel-item>
</el-carousel>
</template>
<script>
export default {
name: "Banner",
}
</script> <style scoped>
.el-carousel__item h3 {
color: #475669;
font-size: 18px;
opacity: 0.75;
line-height: 300px;
margin: 0;
} .el-carousel__item:nth-child(2n) {
background-color: #99a9bf;
} .el-carousel__item:nth-child(2n+1) {
background-color: #d3dce6;
}
.el-carousel__item img {
text-align: center;
height: 520px;
margin: 0 auto;
display: block;
}
</style>

页脚组件:components/Footer.vue

<template>
<div class="footer">
<ul>
<li>关于我们</li>
<li>联系我们</li>
<li>商务合作</li>
<li>帮助中心</li>
<li>意见反馈</li>
<li>新手指南</li>
</ul>
<p>Copyright © luffycity.com版权所有 | 京ICP备17072161号-1</p>
</div>
</template> <script>
export default {
name: "Footer"
}
</script> <style scoped>
.footer {
width: 100%;
height: 128px;
background: #25292e;
color: #fff;
} .footer ul {
margin: 0 auto 16px;
padding-top: 38px;
width: 810px;
} .footer ul li {
float: left;
width: 112px;
margin: 0 10px;
text-align: center;
font-size: 14px;
} .footer ul::after {
content: "";
display: block;
clear: both;
} .footer p {
text-align: center;
font-size: 12px;
}
</style>

主页组件:views/Home.vue

<template>
<div class="home">
<Header />
<Banner />
<Footer />
</div>
</template> <script>
import Header from '@/components/Header'
import Banner from '@/components/Banner'
import Footer from '@/components/Footer' export default {
name: 'home',
components: {
Header,
Banner,
Footer
},
}
</script>

luffy前台配置的更多相关文章

  1. 7.vue前台配置、插件、组件

    目录 luffy前台配置 axios前后台交互 cookies操作 element-ui页面组件框架 bootstrap页面组件框架 luffy前台配置 axios前后台交互 安装:前端项目目录下的终 ...

  2. luffy项目:基于vue与drf前后台分离项目(2)

    user模块User表 创建user模块 前提:在 luffy 虚拟环境下 1.终端从项目根目录进入apps目录 >: cd luffyapi & cd apps 2.创建app > ...

  3. luffy项目:基于vue与drf前后台分离项目(1)

    """ 1.业务逻辑:登录注册 - 主页(基础信息展示) - 课程页(复杂信息展示)- 课程订单生产与支付 - 上线订单生成 2.实际项目开发的技术点: git版本控制 ...

  4. nodejs+mongodb+vue前后台配置ueditor

    笔者在做一个个人博客项目的时候需要一个富文本框输入组件与后台进行交互,但是官方配置里面没有关于nodejs的,于是自己查阅资料研究了一下,最后终于应用到了系统中. 一.后台配置 首先是找到了这个项目: ...

  5. luffy项目后台drf搭建(1)

    一 进入虚拟环境 打开crm,输入命令 workon luffy 虚拟环境使用文档 二 安装基本类库 pip install django pip install PymySQL pip instal ...

  6. ThinkPHP5.0框架开发--第3章 TP5.0 配置

    ThinkPHP5.0框架开发--第3章 TP5.0 配置 第3章 TP5.0 配置 ========================================================= ...

  7. luffy 那点事

    1 虚拟环境创建 2 后台:Django项目创建 3 后台配置 4 数据库配置 5 user模块User表 6 前台 7 前台配置 8 前端主页 9 后端主页模块设计 10 xadmin 后台管理 1 ...

  8. DRF+Vue项目(一)——项目架构

    永久配置安装源 为了加速模块的下载 1.文件管理器文件路径地址栏敲:%APPDATA% 回车,快速进入 C:\Users\电脑用户\AppData\Roaming 文件夹中 2.新建 pip 文件夹并 ...

  9. 路飞-git操作

    复习 """ 1.pip换源 - 采用国内源下载,速度快 2.虚拟环境 - 可以为项目单独配置开发环境,方便管理依赖模块及模块的版本迭代 3.后台项目重构目录结构 4.后 ...

随机推荐

  1. HTML/HTML5 知识点思维导图

    1 - 浏览器 | 浏览器页面构成 2 - 浏览器 | 浏览器内核相关知识点 3 - W3C | 对WEB标准以及W3C的理解与认识? 4 - 标签 | Doctype相关知识点 5 - 标签 | m ...

  2. 【平台中间件】为什么用etcd而不用ZooKeeper?从应用场景到实现原理的全方位解读

    前言 博主在工作过程中经常接触到ETCD,搜索相关资料的时候发现排名最高的是一篇图片全是404的转载文章,后来看到了原文,感觉有义务让更多的人看到这样的精品文章,所以进行了转载. 原文发布在infoQ ...

  3. idea2018.3.2版本如何破解

    IntelliJ IDEA2018破解教程(2019.1.11更新)破解方法:下载破解补丁→修改配置文件→输入激活码→激活成功 由于JetBrains封杀,大部分激活服务器已经不能使用,使用下面的比较 ...

  4. 使用Pillow(PIL)库实现中文字符画

    上班摸鱼写的,不多说了,直接上脚本 #coding=utf-8 from PIL import Image from PIL import ImageDraw from PIL import Imag ...

  5. springboot使用RestTemplate以post方式发送json字符串参数(以向钉钉机器人发送消息为例)

    使用springboot之前,我们发送http消息是这么实现的 我们用了一个过时的类,虽然感觉有些不爽,但是出于一些原因,一直也没有做处理,最近公司项目框架改为了springboot,springbo ...

  6. laravel-5.3(1) 路由配置

    第一步: 按照上一篇搭建好工程后可以看到框架默认的 welcome 默认视图: 一般的web 开发框架是MVC设计模式,那么我们现在创建自己的控制器和视图,CMD 进入到工程根目录执行 php art ...

  7. js对象和jQuery对象的区别

    (1)js对象的三种基本定位方式 (A)通过ID属性:document.getElementById() (B)通过NAME属性:document.getElementsByName() (C)通过标 ...

  8. 微信小程序tabBar的一个小坑

    开始接触微信小程序的项目开发时,自己想添加底部导航,按照文档的方法在app.json添加tabBar,结果编译不出,工具台也没错误提示. 尝试在网上搜一下,看到有碰到类似情况的,解决方法是:app.j ...

  9. 【查看修复HDFS中丢失的块】org.apache.hadoop.hdfs.BlockMissingException: Could not obtain block: BP

    首先得好看有多少损坏的文件,其中需要使用Hadoop的fsck命令: 以下是官方解释 用法:  hadoop fsck  //路径 以上将会展示该路径下所有受损的文件 最后用-delete 可以清除掉 ...

  10. 安装k8s-1master多node节点

    卸载比较新的18.3版本,安装17.03版本 删除旧版本 sudo yum remove docker \ docker-client \ docker-client-latest \ docker- ...