当前位置: 首页 > news >正文

网站seo主管招聘内黄县住房和城乡建设局网站

网站seo主管招聘,内黄县住房和城乡建设局网站,wordpress编辑器技巧,想做服装电商怎么入手一、Home页面组件结构 结构拆分 创建组件 在 views/Home 目录下创建component 目录, 然后在该目录下创建5个组件: 左侧分类(HomeCategory.vue)、Banner(HomeBanner.vue)、精选商品(HomeHot.vue)、低价商品(Homecheap.vue)、最新上架(HomeNew.vue) 引用组件 修改 views/Home…一、Home页面组件结构 结构拆分 创建组件 在 views/Home 目录下创建component 目录, 然后在该目录下创建5个组件: 左侧分类(HomeCategory.vue)、Banner(HomeBanner.vue)、精选商品(HomeHot.vue)、低价商品(Homecheap.vue)、最新上架(HomeNew.vue) 引用组件 修改 views/Home/index.vue 的代码 templatediv classcontainerHomeCategory/HomeCategoryHomeBanner/HomeBanner/divHomeHot/HomeHotHomeCheap/HomeCheapHomeNew/HomeNew /templatescript import HomeBanner from ./component/HomeBanner.vue import HomeCategory from ./component/HomeCategory.vue import HomeHot from ./component/HomeHot.vue import HomeNew from ./component/HomeNew.vue import HomeCheap from ./component/HomeCheap export default {components:{HomeBanner,HomeCategory,HomeHot,HomeNew,HomeCheap}} /scriptstyle/style二、安装Pinia 添加依赖 pinia依赖和持久化插件 npm install pinia npm install pinia-plugin-persist 创建文件 在 stores 目录下创建 category.js 文件 import { ref } from vue import { defineStore } from pinia 引入 修改 main.js 文件 import { createApp } from vue import App from ./App.vue import router from ./router import store from ./store import { createPinia } from pinia import piniaPersist from pinia-plugin-persist import ElementPlus from element-plus import /assets/iconfont/iconfont.js import /assets/iconfont/iconfont.css// import ./styles/element/index.scssconst pinia createPinia() pinia.use(piniaPersist) const app createApp(App)app.use(store).use(router).use(pinia).use(ElementPlus).mount(#app)三、分类功能实现 封装接口 在 api 目录下创建 home 目录然后创建 category.js 文件 import http from /utils/httpexport function getCategoryAPI () {return http({url: /home/category/list,method: get,}) }前提: 后端要返回相应的数据 修改 /store/category.js import { ref } from vue import { defineStore } from pinia import { getCategoryAPI } from /api/home/categoryexport const useCategoryStore defineStore(category, () {// 导航列表数据管理//state 导航列表数据const categoryList ref([])// action 获取导航数据的方法const getCategory async () {const res await getCategoryAPI();console.log(res);categoryList.value res.data;}return {categoryList, getCategory} })代码示范 HomeCategory.vue script setup import { useCategoryStore } from /store/category const categoryStore useCategoryStore() console.log(categoryStore); /scripttemplatediv classhome-categoryul classmenuli v-foritem in categoryStore.categoryList :keyitem.idi :classitem.icon/irouter-link to/{{ item.categoryName }}/router-linkspan classmorea href//a/span!-- 弹层layer位置 --!-- div classlayerh4分类推荐 small根据您的购买或浏览记录推荐/small/h4ulli v-fori in 5 :keyiRouterLink to/img alt /div classinfop classname ellipsis-2男士外套/pp classdesc ellipsis男士外套冬季必选/pp classpricei¥/i200.00/p/div/RouterLink/li/ul/div --/li/ul/div /templatestyle scoped langscss .home-category {width: 250px;height: 500px;background: #f2f2f2;position: relative;z-index: 99;.menu {li {padding-left: 40px;height: 55px;line-height: 55px;text-align: left;padding-right: 15px;border-bottom: solid .1px #000;.iconfont{font-size: 22px;line-height: 55px;margin-right: 10px;top: 5px;color: rgb(0, 110, 255);}:hover {background: $lygColor;}a {position: absolute;margin-right: 4px;color: #000;:first-child {font-size: 16px;}}.more{float: right;font-size: 18px;}.layer {width: 990px;height: 500px;background: rgba(255, 255, 255, 0.8);position: absolute;left: 250px;top: 0;display: none;padding: 0 15px;h4 {font-size: 20px;font-weight: normal;line-height: 80px;small {font-size: 16px;color: #666;}}ul {display: flex;flex-wrap: wrap;li {width: 310px;height: 120px;margin-right: 15px;margin-bottom: 15px;border: 1px solid #eee;border-radius: 4px;background: #fff;:nth-child(3n) {margin-right: 0;}a {display: flex;width: 100%;height: 100%;align-items: center;padding: 10px;:hover {background: #e3f9f4;}img {width: 95px;height: 95px;}.info {padding-left: 10px;line-height: 24px;overflow: hidden;.name {font-size: 16px;color: #666;}.desc {color: #999;}.price {font-size: 22px;color: $priceColor;i {font-size: 16px;}}}}}}}// 关键样式 hover状态下的layer盒子变成block:hover {.layer {display: block;}}}} } /style四、banner功能实现 接口封装 在 api 目录下创建 home 目录然后创建 banner.js 文件 import http from /utils/httpexport function getBannerAPI () {return http({url: /home/banner/list,method: get,}) }代码示范 HomeBanner.vue script setup import { getBannerAPI } from /api/home/banner import { onMounted, ref } from vueconst bannerList ref([])const getBanner async () {const res await getBannerAPI()console.log(res)bannerList.value res.data }onMounted(() getBanner()); console.log(bannerList) /scripttemplatediv classhome-bannerel-carousel height500pxel-carousel-item v-foritem in bannerList :keyitem.idimg :srcrequire(/assets/img/${item.img1}.jpg) alt/el-carousel-item/el-carousel/div /templatestyle scoped langscss .home-banner {width: 1127px;height: 500px;position: absolute;left: 250px;top: 185px;z-index: 98;img {width: 100%;height: 500px;} } /style五、创建公共组件 创建文件 在 views/Home/components 路径下创建 HomePanel.vue 文件 script setup //定义 Props主标题和副标题 defineProps({title: {type: String},subTitle: {type: String} }) /scripttemplatediv classhome-paneldiv classcontainerdiv classhead!-- 主标题和副标题 --h3{{title}}small{{ subTitle }}/small/h3/div!-- 主体内容区域 插槽--slot/ /div/div /templatestyle scoped langscss .home-panel {background-color: #fff;.head {padding: 40px 0;display: flex;align-items: flex-end;h3 {flex: 1;font-size: 32px;font-weight: normal;margin-left: 6px;height: 35px;line-height: 35px;small {font-size: 16px;color: #999;margin-left: 20px;}}} } /style六、精选商品实现 接口封装 在 api 目录下创建 home 目录然后创建 hot.js 文件 代码示范 HomeHot.vue script setup import HomePanel from ./HomePanel.vue; import { ref, onMounted } from vue import { getHotAPI } from /api/home/hotconst hotList ref([]) const getHotList async() {const res await getHotAPI()console.log(res)hotList.value res.data }onMounted(() {getHotList() }) /scripttemplateHomePanel title精选商品 sub-title人气精选 不容错过!-- 下面是插槽主体内容模版 --ul classgoods-listli v-foritem in hotList :keyitem.idRouterLink to/img :srcrequire(/assets/img/${item.picture1}.jpg) :altitem.alt /p classname{{ item.goodsName }}/pp classpriceyen;{{ item.price }}/p/RouterLink/li/ul/HomePanel /templatestyle scoped langscss .goods-list {display: flex;justify-content: space-between;height: 406px;width: 100%;li {width: 306px;height: 406px;background: #f0f9f4;transition: all .5s;:hover {transform: translate3d(0, -3px, 0);box-shadow: 0 3px 8px rgb(0 0 0 / 20%);}img {width: 306px;height: 306px;}p {font-size: 22px;padding-top: 12px;text-align: center;text-overflow: ellipsis;overflow: hidden;white-space: nowrap;color: #000;}.price {color: $priceColor;}} } /style七、低价好物 接口封装 在 api 目录下创建 home 目录然后创建 cheap.js 文件 代码示范 HomeCheap.vue script setup import HomePanel from ./HomePanel.vue; import { ref, onMounted } from vue import { getCheapAPI } from /api/home/cheapconst cheapList ref([]) const getCheapList async() {const res await getCheapAPI()console.log(res)cheapList.value res.data }onMounted(() {getCheapList() }) /scripttemplateHomePanel title低价好物 sub-title价低质不低 不容错过!-- 下面是插槽主体内容模版 --ul classgoods-listli v-foritem in cheapList :keyitem.idRouterLink to/img :srcrequire(/assets/img/${item.picture1}.jpg) :altitem.alt /p classname{{ item.goodsName }}/pp classpriceyen;{{ item.price }}/p/RouterLink/li/ul/HomePanel /templatestyle scoped langscss .goods-list {display: flex;justify-content: space-between;height: 406px;width: 100%;li {width: 306px;height: 406px;background: #f0f9f4;transition: all .5s;:hover {transform: translate3d(0, -3px, 0);box-shadow: 0 3px 8px rgb(0 0 0 / 20%);}img {width: 306px;height: 306px;}p {font-size: 22px;padding-top: 12px;text-align: center;text-overflow: ellipsis;overflow: hidden;white-space: nowrap;color: #000;}.price {color: $priceColor;}} } /style八、最新上架 接口封装 在 api 目录下创建 home 目录然后创建 new.js 文件 代码示范 HomeNew.vue script setup import HomePanel from ./HomePanel.vue; import { ref, onMounted } from vue import { getNewAPI } from /api/home/newconst newList ref([]) const getNewList async() {const res await getNewAPI()console.log(res)newList.value res.data }onMounted(() {getNewList() }) /scripttemplateHomePanel title最新上架 sub-title新鲜出炉 品质保障!-- 下面是插槽主体内容模版 --ul classgoods-listli v-foritem in newList :keyitem.idRouterLink to/img :srcrequire(/assets/img/${item.picture1}.jpg) :altitem.alt /p classname{{ item.goodsName }}/pp classpriceyen;{{ item.price }}/p/RouterLink/li/ul/HomePanel /templatestyle scoped langscss .goods-list {display: flex;justify-content: space-between;height: 406px;width: 100%;li {width: 306px;height: 406px;background: #f0f9f4;transition: all .5s;:hover {transform: translate3d(0, -3px, 0);box-shadow: 0 3px 8px rgb(0 0 0 / 20%);}img {width: 306px;height: 306px;}p {font-size: 22px;padding-top: 12px;text-align: center;text-overflow: ellipsis;overflow: hidden;white-space: nowrap;color: #000;}.price {color: $priceColor;}} } /style
http://www.zqtcl.cn/news/901029/

相关文章:

  • 建筑企业资质查询网站怎么查网络服务商
  • 汉川市城乡建设局网站企业销售网站建设
  • 梅州建设网站域名购买流程
  • 单页网站与传统网站的区别wordpress对接微信
  • 做公司网站深圳旅游
  • 最好企业网站网站建设 的销售图片
  • 怎么创建网站 免费滴做网站算运营吗
  • 廊坊网站建设-商昊网络正规网站优化推广
  • 网站建设拍金手指排名贰贰安装wordpress数据库错误
  • 食品网站建设需求分析购物app大全
  • 电商美工广州seo技术外包公司
  • 重庆旅游seo整站优化深圳宝安区是富人区吗
  • 网站开发验收模板网站欧美风格
  • 自己做发卡网站什么是网络设计制作
  • 如何搭建一个公司网站互联网推广怎么找客户
  • 江苏同隆建设集团有限公司网站asp.net新建网站
  • 爱站网挖掘工具小程序网站开发怎么样
  • 网站文章批量上传工具自己制作免费网站
  • 凡科快速建站建设网站遇到问题的解决方案
  • 深圳市公司网站建设公司十大互联网营销公司
  • 免费发布推广信息的网站百度招聘2022年最新招聘
  • 建站公司怎么获客任县附近网站建设价格
  • 泰兴市淘宝网站建设指数 网站权重
  • 烟台市做网站找哪家好才艺多网站建设
  • nginx wordpress 重写seo技术大师
  • 公司网站建设需要什么科目上海服务政策调整
  • 如何免费搭建自己的网站网站建设公司swot分析
  • 太原网站优化技术如何开发一款app软件
  • 莆田做网站公司lnmp wordpress 404
  • 网站开发中的qq登录网站地图有什么作用