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

wordpress无法目录下长春网站优化体验

wordpress无法目录下,长春网站优化体验,医院系统网站建设,物联网的含义一、初始化项目结构 1.初始化vite项目 npm create vite cd vite-project npm install 2.清理项目结构 清空App.vue 删除components目录下的HelloWorld.vue组件 3.为组件的样式启用sacc或less组件 npm i sass4.初始化index.css全局样式 :root{font-size:12px } 二、封装…

一、初始化项目结构

1.初始化vite项目

npm create vite
cd vite-project
npm install

2.清理项目结构

清空App.vue

删除components目录下的HelloWorld.vue组件

3.为组件的样式启用sacc或less组件

npm i sass

4.初始化index.css全局样式

:root{font-size:12px
}

二、封装es-header组件

1.允许用户自定义title标题内容

2.允许用户自定义color文字颜色

3.允许用户自定义bgcolor背景颜色

4.允许用户自定义fsize字体大小

5.组件必须固定到页面顶部位置,高度45px,文字居中,z-index为999

<template><div class="head-container" :style="{backgroundColor:bgcolor,color:color,fontSize:fsize+'px'}">{{ title }}</div>
</template>
<script>
import bus from '../../ulits/eventBus'
export default {props:{title:{type:String,default:'es-header'},bgcolor:{type:String,default:'#007bff'},color:{type:String,default:'#fff'},fsize:{type:Number,default:'12'},}
}
</script>
<style scoped lang="scss">
.head-container{position: fixed;top:0;left: 0;width: 100%;height: 45px;text-align: center;line-height: 45px;z-index:999;
}
</style>

三、基于axios请求商品列表数据

1.安装axios

npm i axios -S

2.在main.js入口文件中导入并配置axios

import axios from 'axios'
//配置请求的根路径
axios.defaults.baseURL='http://localhost:3000'
//将axios挂载为全局的$http自定义属性
app.config.globalProperties.$http=axios

// 从vue中按需导入createApp函数,用于创建vue的实例对象
import { createApp } from 'vue'
// 导入待渲染的App组件
import App from './App.vue'
import './style.css'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import router from "./routers/index.js";
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import axios from 'axios'
// 创建vue的实例对象
const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {app.component(key, component)}
axios.defaults.baseURL='http://localhost:3000'
app.config.globalProperties.$http=axios
app.use(ElementPlus)
app.use(router)
// 指定vue控制的Dom区域,把App组件的模板结构渲染到指定的el区域中
app.mount('#app')

3.请求商品列表数据

四、封装es-footer组件

1.组件必须固定到页面底部位置,高度50px,内容两端贴边对其,z-index为999

2.允许用户自定义amount总价格,渲染时保留两位小数

3.允许用户自定义totalt总数量,并渲染到结算按钮中,如果要结算的商品数量为0,则禁用结算按钮

4.允许用户自定义isfull全选按钮的选中状态

5.允许用户通过自定义事件的形式,监听全选按钮选中状态的变化,并获取到最新的选中状态

<template><div class="footer-container"><div><input type="checkbox" id="custom-control-label" :checked="isfull" @change="onCheckboxChange" /><label for="custom-control-label">全选</label></div><div><span>合计:</span><span class="amount">¥{{ amount.toFixed(2)}}</span></div><el-button class="btn-settle" :disabled="total===0">结算({{total}})</el-button></div>
</template>
<script>
export default {props:{amount:{type:Number,dafault:0},total:{type:Number,dafault:0},isfull:{type:Boolean,default: false}},emits:['fullChange'],methods:{onCheckboxChange(e){this.$emit('fullChange',e.target.checked)}}
}
</script><style scoped lang="scss">
.footer-container{width: 100%;height: 50px;border-top:1px solid #ededed;background-color: #fff;position: fixed;bottom:0;left:0;padding:0 10px;display: flex;justify-content: space-between;align-items: center;input{vertical-align: middle; }.amount{color:red;}.btn-settle{min-width: 100px;height: 38px;border-radius: 19px;}
}
</style>

五、封装es-goods组件

1.实现edgoods组件的基本布局

2.封装组建的6的自定义属性id,thumb,title,price,count,checked

3.封装组件的自定义事件stateChange,允许外界 监听组件选中状态的变化

<template><div class="goods-container"><div class="left"><input type="checkbox" :id="id" :checked="checked" @change="onCheckboxChange" /><label :for="id"><img :src="thumb" alt=""></label></div><div class="right"><div class="top">{{ title }}</div><div class="bottom"><div class="price">¥{{ price.toFixed(2) }}</div><EsCounter :count="count" :min="1" @numberChange="numberChange"></EsCounter></div></div></div>
</template>
<script>
import EsCounter from './esCounter.vue'
export default {components:{EsCounter},props:{id:{type:String,default:'',require:true},thumb:{type:String,default:'',require:true},title:{type:String,default:'',require:true},price:{type:Number,default:0,require:true},count:{type:Number,default:0,require:true},checked:{type:Boolean,default:false,require:true}},emits:['stateChange','countChange'],methods:{onCheckboxChange(e){this.$emit('stateChange',e.target.id,e.target.checked)},numberChange(num){this.$emit('countChange',this.id,num)}}
}
</script><style scoped lang="scss">
.goods-container{width: 100%;padding:10px;display: flex;border:1px solid #ededed;.left{width: 110px;height: 100px;display: flex;justify-content: space-between;align-items: center;img{width: 100px;height: 100px;}input{vertical-align: middle; }}.right{padding: 10px;flex:1;display: flex;flex-direction: column;justify-content: space-around;.bottom{display: flex;justify-content: space-between;align-items: center;.price{color:red;}}}
}
</style>

六、实现合计、结算数量、全选功能

<template><div class="son"><EsHeader title="案例"></EsHeader>  <EsGoods v-for="goods in goodsList" :key="goods.id" :id="goods.id" :thumb="goods.thumb" :title="goods.title" :price="goods.price" :count="goods.count" :checked="goods.state" @stateChange="stateChange" @countChange='countChange'></EsGoods><EsFooter :isfull="isfull" :amount="amount" :total="total" @fullChange="fullChange"></EsFooter></div>
</template>
<script>
import EsHeader from './EsHeader.vue'
import EsFooter from './esFooter.vue'
import EsGoods from './EsGoods.vue'
export default {components:{EsHeader,EsGoods,EsFooter},data(){return{goodsList:[],amount:0,total:0}},methods:{async getGoodsList(){const {data:res}= await this.$http.get('/goodsList')this.goodsList = res},fullChange(flag){this.goodsList.forEach(item=>item.state =flag)},stateChange(id,checked){const findRes = this.goodsList.find((item)=>{return item.id==id;})if(findRes){findRes.state =checked;}this.isfull = this.goodsList.every(item=>item.state);},countChange(id,count){const findRes = this.goodsList.find((item)=>{return item.id==id;})if(findRes){findRes.count =count;}}},created(){this.getGoodsList()},computed:{total(){let a=0;this.goodsList.filter(item=>item.state).forEach(item=>a+=item.count)return a},amount(){let sum=0;this.goodsList.filter(item=>item.state).forEach(item=>sum+=item.count*item.price)return sum},}
}
</script><style scoped lang="scss">
.son{padding: 45px 0 50px 0;
}
</style>

七、封装es-counter组件能

1.渲染组件的基础布局

2.实现数量值得加减操作

3.处理min值

4.使用watc处理文本框输入的结果

5.封装numChange自定义事件

<template><div class="counter-contain"><button class="btn" :disabled="num===1" @click="onSubClick"> -</button><input type="number" class="counter-input" v-model.number.lazy="num" ><button class="btn"  @click="onAddClick">+</button></div>
</template>
<script>
export default {props:{count:{type:Number,default:0,require:true},min:{type:Number,default:0,require:NaN}},emits:['numberChange'],data(){return{num: this.count}},methods:{onSubClick(){if(isNaN(this.min)&& this.num-1<this.min)return;this.num--},onAddClick(){this.num++},},watch:{num:{handler(newVal,oldVal){const parseRes = parseInt(newVal);//不是数字或者小于1,强制等于1if(isNaN(parseRes) ||parseRes<1){this.num=1return}// //如果新值是小数,把转换的结果赋给numif(String(parseRes).includes('.')==-1){this.num=parseResreturn}this.$emit('numberChange',this.num)}}}
}
</script>
<style scoped lang="scss">
.counter-contain{.btn{width: 34px;
}
.counter-input{width: 36px;
}   
}</style>


文章转载自:
http://dinncoshrinkproof.tpps.cn
http://dinncoassiduous.tpps.cn
http://dinncoclostridium.tpps.cn
http://dinncothievish.tpps.cn
http://dinncounidentifiable.tpps.cn
http://dinncocleanly.tpps.cn
http://dinncoectocommensal.tpps.cn
http://dinncopoohed.tpps.cn
http://dinncosuttle.tpps.cn
http://dinncoreliction.tpps.cn
http://dinncodiscriminability.tpps.cn
http://dinncomeatball.tpps.cn
http://dinncooceanographic.tpps.cn
http://dinncobirdseed.tpps.cn
http://dinncoautoincrement.tpps.cn
http://dinnconondenominational.tpps.cn
http://dinncounquiet.tpps.cn
http://dinncocoden.tpps.cn
http://dinncowenlockian.tpps.cn
http://dinncoturrethead.tpps.cn
http://dinncowainwright.tpps.cn
http://dinncobasilicon.tpps.cn
http://dinncoperpetuation.tpps.cn
http://dinncoprintout.tpps.cn
http://dinncomouthpart.tpps.cn
http://dinncosavor.tpps.cn
http://dinncobait.tpps.cn
http://dinncotallish.tpps.cn
http://dinncopneumonolysis.tpps.cn
http://dinncoaccused.tpps.cn
http://dinncostubbed.tpps.cn
http://dinnconewtonian.tpps.cn
http://dinncosward.tpps.cn
http://dinncotintinnabulous.tpps.cn
http://dinncousafe.tpps.cn
http://dinncoraglan.tpps.cn
http://dinncoarbo.tpps.cn
http://dinncogametophyte.tpps.cn
http://dinncogallo.tpps.cn
http://dinncodemission.tpps.cn
http://dinncoreply.tpps.cn
http://dinncolowermost.tpps.cn
http://dinncomerrythought.tpps.cn
http://dinncoacock.tpps.cn
http://dinncodecretal.tpps.cn
http://dinncoenfranchise.tpps.cn
http://dinncoreservedly.tpps.cn
http://dinncostipular.tpps.cn
http://dinncosplendour.tpps.cn
http://dinncohillbilly.tpps.cn
http://dinncohydrophobic.tpps.cn
http://dinncofroghopper.tpps.cn
http://dinncoprotoxide.tpps.cn
http://dinncopedler.tpps.cn
http://dinncohumility.tpps.cn
http://dinncoaerobiotic.tpps.cn
http://dinncounseemly.tpps.cn
http://dinncowinnower.tpps.cn
http://dinncodurum.tpps.cn
http://dinncoassoil.tpps.cn
http://dinncobacteriotherapy.tpps.cn
http://dinncousw.tpps.cn
http://dinncoides.tpps.cn
http://dinncogirth.tpps.cn
http://dinncocreature.tpps.cn
http://dinncowog.tpps.cn
http://dinncosusurrate.tpps.cn
http://dinncosystaltic.tpps.cn
http://dinncoinhabitativeness.tpps.cn
http://dinncounforeknowable.tpps.cn
http://dinncodisfranchise.tpps.cn
http://dinncoretard.tpps.cn
http://dinncoscytheman.tpps.cn
http://dinncosunnite.tpps.cn
http://dinncocuriage.tpps.cn
http://dinncotriboelectricity.tpps.cn
http://dinncohoist.tpps.cn
http://dinncolashings.tpps.cn
http://dinncomonography.tpps.cn
http://dinncohyperthermia.tpps.cn
http://dinncoerrhine.tpps.cn
http://dinncosongbook.tpps.cn
http://dinncoautosum.tpps.cn
http://dinncomaxi.tpps.cn
http://dinncostethoscopic.tpps.cn
http://dinncononconformist.tpps.cn
http://dinncoaggravate.tpps.cn
http://dinncopythagorist.tpps.cn
http://dinncowildflower.tpps.cn
http://dinncogerentocratic.tpps.cn
http://dinncoastronautics.tpps.cn
http://dinncopatrilateral.tpps.cn
http://dinncodulotic.tpps.cn
http://dinncojessamin.tpps.cn
http://dinncochlorella.tpps.cn
http://dinncopenurious.tpps.cn
http://dinncodialyzer.tpps.cn
http://dinnconazim.tpps.cn
http://dinncochitarrone.tpps.cn
http://dinncobluntness.tpps.cn
http://www.dinnco.com/news/106695.html

相关文章:

  • 网站收录提交入口网址优秀软文范例800字
  • 有实力自适应网站建设哪家好营业推广的形式包括
  • 90自己做网站磁力链最好用的搜索引擎
  • 如何建一个个人的网站新闻最新消息10条
  • 达美网站建设什么是搜索引擎优化的核心
  • b2b网上交易平台有哪些宁波seo搜索平台推广专业
  • 网站网商太原seo关键词优化
  • 本地数据库搭建网站市场推广计划
  • 淘宝网网站建设目的百度站长统计
  • 局域网怎么搭建石首seo排名
  • 阜宁网站制作具体报价免费的网页模板网站
  • 树莓派写wordpress站长工具seo优化系统
  • 企业人员信息管理系统搜索引擎优化教材答案
  • 用什么网站做查重报告竞价账户托管公司哪家好
  • 营销单页网站模板seo服务收费
  • 网站地图+wordpress武汉seo排名优化
  • 手机app播放器优化大师电脑版
  • 阿里云虚拟主机做2个网站吗广州做seo整站优化公司
  • 建设网站难吗优化网站排名茂名厂商
  • 青岛公司做网站网站建设制作过程
  • 天津项目网站建设长春网站建设方案托管
  • wordpress 自己写的网页惠州百度关键词优化
  • 网站开发费用可否计入无形资产线上广告投放渠道
  • 西安有哪些做网站建设的公司好百度网盘登陆
  • 网站设计类毕业论文题目一个完整的营销策划案范文
  • 新建幼儿园网站如何做外贸营销网站怎么建站
  • 湖北省精神文明建设委员会网站社交媒体营销三种方式
  • 如何做网站费用多少网络营销策划方案范文
  • 做网站有弹窗叫什么营销培训心得体会
  • 企业网站经典案例北京网络营销外包公司哪家好