- 博客(10)
- 收藏
- 关注
转载 笔记 http请求 各项参数的意义
Header 解释 示例Accept 指定客户端能够接收的内容类型 Accept: text/plain, text/htmlAccept-Charset 浏览器可以接受的字符编码集。 Accept-Charset: iso-8859-5Accept-Encoding 指定浏览器可以支持的web服务器返回内容压缩编码类型。 Accept-Encoding: compress, gzipAccept-Language 浏览器可接受的语言 Ac...
2021-02-27 12:57:19
361
原创 vue 动态绑定class 选中样式
如何给选中元素添加样式html 代码 <div class="navTitle"> <span v-for="(item,idx) in nameText" :key="idx" :class="isSel==idx?'spanSel':''" @mouseover="isSelSty(idx)" @mouseout="removeSel">{{item}}</span> </div>javascript 代码 data() {
2021-02-22 14:21:40
752
原创 vue 组件传值 子传父
父组件代码1、父组件中需要做的是,定义一个方法;2、其中changeTitle是子组件通过$emit(第一个参数,第二个参数)传递过来时的第一个参数3、在方法 chengtitleA 中进行子组件传递过来的数据操作;<template> <div class="mainPage"> <div class="title" > <bartitle @changeTitle='chengtitleA'></
2020-09-21 16:06:47
400
原创 vue 组件传值 父传子及注意事项
子组件在哪里使用,哪里就是子组件的父级;其中bartitle 为在父组件中注册的名字;自定义属性通过 :绑定,本文中例子,自定义属性为 :titleTextMain1、通过import 引入子组件,并起名字 bartitle;2、在script中components中注册;3、在页面使用注意事项:1、在页面使用中不能使用驼峰命名,如果引入为barTiltle,那再页面需要写成bar-title;父组件代码<template> <div class="mainPa
2020-09-21 15:51:36
466
原创 小程序中如何取消内置导航让图片占满屏幕
在app.json中设置 “navigationStyle”: “custom” "window":{ "backgroundTextStyle":"light", "navigationBarBackgroundColor": "#ffffff", "navigationBarTitleText": "", "navigationBarTextStyle":"black", "navigationStyle": "custom" },注意事项:这个属性会
2020-07-30 10:07:34
390
原创 小程序picker数组对象的运用
小程序中返回数据为[{id:0,name:‘wang’},{id:1,name:‘liang’}]如何处理?wxml<picker class="pickerI" bindchange="bindPickerChange" value="{{pickerIndex}}" range="{{arrList}}" range-key='des'> <view class="picker"> 当前选择:{{arrList[pickerIndex].des}} </vie
2020-07-29 18:04:50
1263
原创 小程序中如何消除图片之间的空隙
小程序不加margin、padding仍然会有空隙,消除空隙的方法为给image添加display:flex; 即可消除间隙。
2020-07-29 10:24:32
1947
原创 小程序自定义组件属性及方法
组件html<view class="input" ><text class="name">{{name}}</text><input bindblur="inputBlur"></input><text class="line">|</text><text class="words">{{words}}</text></view>组件jsComponent({ pr
2020-07-29 09:31:07
1114
原创 小程序前端获取openId和session_key
loginId: function () { var that = this // 优化加载...... if (that.data.boo) { wx.showLoading({ title: '加载中', }) } //获取code wx.login({ success(resp) { that.setData({ loginCode:resp.code
2020-07-28 17:27:22
754
原创 小程序封装请求方法及踩过的坑
/** * HTTP_BASE_URL: 请求地址 * _method: 请求方法 * data:发送数据 * callback:回调函数 * boo作用: 请求接口时, 显示loadding, 默认"显示" */const app = getApp();const HTTP_BASE_URL = "服务器地址=====/";//测试地址 提交function api(_method, url, data, callback, boo = true) { console.log(d
2020-07-28 17:04:56
300
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅