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

哪个网站可以做网红wordpress菜单锚点定位

哪个网站可以做网红,wordpress菜单锚点定位,wordpress编辑区,网页制作公司 大连一、http-vue-loader.js http-vue-loader.js 是一个 Vue 单文件组件加载器#xff0c;可以让我们在传统的 HTML 页面中使用 Vue 单文件组件#xff0c;而不必依赖 Node.js 等其他构建工具。它内置了 Vue.js 和样式加载器#xff0c;并能自动解析 Vue 单文件组件中的所有内容…一、http-vue-loader.js http-vue-loader.js 是一个 Vue 单文件组件加载器可以让我们在传统的 HTML 页面中使用 Vue 单文件组件而不必依赖 Node.js 等其他构建工具。它内置了 Vue.js 和样式加载器并能自动解析 Vue 单文件组件中的所有内容并将其转化为 JavaScript 代码。 ps 注意httpVueLoader 加载的单文件导出方式不同module.exports {}而不是 export default {} 二、示例 这里对了 elementUI 的上传组件做一个封装使其能可根据业务来配置上传的附件 2.1. vue 组件 templatedivel-col :span24 v-for(template,index) in uploadsTemplatesel-card stylemargin-top: 20px;div slotheader classclearfixel-row styledisplay: flex;align-items: center;el-col :span20span stylefont-size: 16px;{{template.title}}/span/el-colel-col :span4 styletext-align: right;el-tag v-iftemplate.required N typeinfo非必上传/el-tagel-tag v-iftemplate.required Y typedanger必须上传/el-tag/el-col/el-row/divp stylecolor: #F56C6C;margin-bottom: 5px;{{template.description}}/pel-col :span12 stylepadding: 20px 0 el-form-item proprequiredFilerefuploadFormItems:rulestemplate.success||template.requiredN?[]:[{required: true, message: 请上传必要件, trigger: blur}]el-rowel-upload :auto-uploadtruedrag:file-listtemplate.fileListrefuploadComponentsnameattachment:on-preview(file)onPreview(file,template):before-upload(file)onBeforeUpload(file,template):on-success(response,file,fileList)onUploadSuccess(response,file,fileList,index):on-remove(file,fileList)onRemoveFile(file,fileList,index,template):actionuploadsUrl:data{ywlx:ywlx,applyNo:applyNo,configId:template.configId}multiplei classel-icon-upload/idiv将文件拖到此处或em点击上传/em/divdiv classel-upload__tip slottip{{msg}}/div/el-upload/el-row/el-form-item/el-col/el-card/el-coldiv classdemo-image__preview styledisplay: noneel-imagestylewidth: 100px; height: 100pxrefimagePreview:srcpreviewSrc:preview-src-listpreviewSrcList/el-image/div/div /templatescript module.exports {name: upload-template,props: [contextPath, applyNo, ywlx, fromedit,msg,beforeUpload],data() {return {uploadsUrl: this.contextPath /system/sysUploadFile/uploadAttachment,//预览图片弹窗imgDialogVisible: false,//预览图片路径previewSrc: ,//预览图片集合previewSrcList: [],// 要件只是校验用requiredFile: [],//上传模板uploadsTemplates: [],//上传前钩子onBeforeUpload: this.beforeUpload}},mounted: function () {if(this.onBeforeUpload null){this.onBeforeUpload (file,upload){return true;}}else{if (typeof this.onBeforeUpload function) {} else {throw new Error(beforeUpload is not a function);}}// 读取附件模板$.ajax({type: get,async: false,url: this.contextPath /system/sysUploadConfig/getUploadsTemplates,data: {ywlx: this.ywlx},dataType: json}).then((response) {if (response.code 0) {response.data.forEach(template {template.success false;template.fileList [];});this.uploadsTemplates.push(...response.data);if (this.fromedit) {$.ajax({type: post,async: false,url: this.contextPath /system/sysUploadFile/getFilesByApplyNo,dataType: json,data: {ywlx:this.ywlx,applyNo: this.applyNo}}).then((response) {if (response.code 0) {response.data.forEach(attachemnt {this.uploadsTemplates.forEach(template {if (attachemnt.configId template.configId) {template.fileList.push(attachemnt);template.success true;}})});} else {this.$message({showClose: true,message: response.msg,type: error,offset: 200,duration: 10000});console.log(error:);console.log(response);}});}} else {this.$message({showClose: true,message: response.msg,type: error,offset: 200,duration: 10000});console.log(error:);console.log(response);}});},methods: {//预览图片onPreview: function (file, template) {this.previewSrc this.contextPath(file.url?file.url:file.response.data.url);template.fileList.forEach((file){this.previewSrcList.push(this.contextPath(file.url?file.url:file.response.data.url));});console.log(this.previewSrc)console.log(this.previewSrcList)this.$refs.imagePreview.clickHandler();},//文件上传成功的回调onUploadSuccess: function (response, file, fileList, index) {console.log(上传成功需要操作请增加事件upload-success)if (response.code 0) {// 把要件列表中的当前这个要件的success置为truethis.uploadsTemplates[index].success true;this.uploadsTemplates[index].fileList fileList;}else {this.$message({showClose: true,message: response.msg,type: error,offset: 200,duration: 2000});//删除控件里某个文件fileList.splice(fileList.indexOf(file),1);}this.$emit(upload-success,response)//清除控件里所有文件// this.$refs.uploadComponents[index].clearFiles();},//移除某个文件onRemoveFile: function (file, fileList, index, upload) {//调用远程移除附件传递file.fileId$.ajax({url: this.contextPath /system/sysUploadFile/removeAttachment,method: post,async: false,data: {fileId: file.fileId?file.fileId:file.response.data.fileId}}).then((response) {if (response.code 0) {this.uploadsTemplates[index].fileList fileList;// 如果已经全部移除加上校验if(fileList.length0){this.uploadsTemplates[index].success false;}} else {console.log(error message:);console.log(response.data);this.$message({showClose: true,message: response.msg,type: error,offset: 200,duration: 2000});}});},}, } /scriptstyle scoped.el-upload__input{display: none;} /style2.2. html 页面 页面中添加 http-vue-loader.js 后添加组件两种方式 方式一 // 使用httpVueLoader Vue.use(httpVueLoader); var vm new Vue({el: #upload-test-form,components: {// 将组建加入组建库upload-template: url:ctxcomponents/upload-template.vue,},data: {ctx:ctx,fromEdit:true,applyForm: {ywlx:ywlx1,applyNo:123456789,},}, });方式二 var vm new Vue({el: #upload-test-form,components: {// 将组建加入组建库upload-template: httpVueLoader(ctxcomponents/upload-template.vue),},data: {ctx:ctx,applyForm: {ywlx:ywlx1,applyNo:123456789,},},});!DOCTYPE html html langzh xmlns:thhttp://www.thymeleaf.org headth:block th:includeinclude :: header(新增上传文件信息) /th:block th:includeinclude :: element-ui(新增上传文件信息) / /head body classwhite-bgdiv classwrapper wrapper-content animated fadeInRight ibox-content idupload-test-formdiv classrowel-form refuploadForm iduploadForm :modelapplyFormupload-template :apply-noapplyForm.applyNo:context-pathctx:before-uploadbeforeUploadupload-successuploadSuccessywlxywlx1/upload-template/el-form/div/divth:block th:includeinclude :: footer /th:block th:includeinclude :: element-ui-js /script th:src{/lib/http-vue-loader.js}/scriptscript th:inlinejavascriptvar prefix ctx system/sysUploadFile;var vm new Vue({el: #upload-test-form,components: {// 将组建加入组建库upload-template: httpVueLoader(ctxcomponents/upload-template.vue),},data: {ctx:ctx,applyForm: {ywlx:ywlx1,applyNo:123456789,},},methods: {beforeUpload: function(file,template){console.log(上传前操作)console.log(file)console.log(template)//返回 true继续上传返回false终止上传return false;},uploadSuccess: function(file){console.log(上传成功操作)console.log(file)}}});function submitHandler() {vm.$refs.uploadForm.validate((valid) {if (valid) {alert(文件验证通过!);} else {alert(文件验证失败!);}});}/script /body /html3.3. 效果 业务类型上传文件配置 业务上传附件页面 保存的文件 总结 通过 http-vue-loader.js我们可以在普通的 HTML 页面中使用 Vue 单文件组件来实现前端开发的快速迭代。在使用 http-vue-loader.js 时我们需要引入 Vue.js 和 http-vue-loader.js并使用 httpVueLoader () 方法加载 Vue 单文件组件并将其实例化为 Vue 对象。
http://www.sczhlp.com/news/279837/

相关文章:

  • 做淘宝一件代发的网站怎样开发自己的app
  • 常州云之家网站建设公司怎么样域名注册申请
  • 凡科可以做游戏网站吗网站开发大数据库
  • 腾讯云做淘客网站权威发布的最新通告
  • 建设网站利用点击量赚钱网上自己建网站
  • 什么是营销网站建设广安网站建设推荐
  • 浙江省建设厅网站张清云公司变更地址需要几天
  • 寻找聊城做网站的公司网站建设后台编程
  • 营销型网站建设公司哪家好哪个好哪里好我先做个网站怎么做的
  • 网站营销方案设计公司wordpress禁用修订
  • 注册网站帐号注销如何做热词网站
  • 网站建设公司信息vs2008 网站消息弹窗怎么做
  • 模板 网站 教程网络营销工具的作用
  • 网站关键词优化排名推荐莆田有建设网站的公司码
  • 浙江住房和城乡建设网站邢台太行中学高考成绩
  • 安顺建设局网站做网站推广的销售发的朋友圈
  • 门户网站欣赏d?t网站模版
  • 自己怎么做网站空间淘宝seo是指什么
  • 如何做自己公司网站公司网站维护主要做什么
  • 韩国导航地图中文版app网站 seo 优化建议
  • 免费简单门户网站开发如何建立企业网站或者官网
  • 南通江苏网站建设wordpress标签库
  • 爱站小工具计算器网站建站是模版好还是设计好
  • 日总结 24
  • flask: 用Flask-Uploads实现文件上传
  • AI元人文:交织的智慧——应对价值困境的四条路径
  • 光学神经网络
  • 2025 年 11 月疥螨阴虱药剂厂家推荐排行榜,扑灭司林,苯甲酸苄酯,胺氯菊百灭宁,科灭达专业配方高效灭杀方案公司推荐
  • 阿里云虚拟主机可以做两个网站吗荥阳做网站
  • 互助金融网站制作个人网站源码进一品资源