随笔分类 - 前端
摘要:1.小程序生命周期 App.js中 App({ onLaunch() { //生命周期回调——监听小程序初始化。全局只触发一次 }, onShow(){ //生命周期回调——监听小程序启动或切前台。 }, onHide(){ //生命周期回调——监听小程序切后台。 }, onError(msg){
阅读全文
摘要:1.数据绑定 WXML中部分数据来自JS中的data 1.1 js中设置数据 data: { myName:"123", title:"weixin", content:"123000", arr:["str","lwx"],//数组 // 对象 obj:{name:"lwx",age:18}, d
阅读全文
摘要:1.新建component 2.使用 2.1 在json中加入 "usingComponents": { "comp":"/components/comp/comp" } 2.2 html使用 <comp></comp> 3.自定义属性值 3.1 在自定义组件的js中 /** * 组件的属性列表 *
阅读全文
摘要:1.view 同div使用 2.swiper滑块视图容器 里面只能嵌套swiper-item组件(宽高自动设置为100%),再嵌套image组件即可 常用属性 <swiper indicator-dots="true" indicator-active-color="red" circular="t
阅读全文
摘要:1.项目目录 2.app.json app.json 是当前⼩程序的全局配置,包括了⼩程序的所有⻚⾯路径、界⾯表现、⽹络超时时间、底部 tab 等。普通快速启动项⽬⾥边的 app.json 配置 2.1 page字段 ⽤于描述当前⼩程序所有⻚⾯路径,这是为了让微信客⼾端知道当前你的⼩程序⻚⾯定义在哪
阅读全文
摘要:1.父容器设置为flex布局,并允许折行 .flex-outer { display: flex; flex-wrap: wrap; } 2.通过修改子容器百分比实现 是n列就把百分比变为100/n(%)
阅读全文
摘要:1.使用flex布局 <style> #back{ border: red solid 1px; width: 800px; height: 500px; display: flex; align-items: center; } #left{ border: blue 1px solid; wid
阅读全文
摘要:https://www.cnblogs.com/hellocd/p/10443237.html
阅读全文
摘要:1.在父元素使用 display: flex; justify-content: center; align-items: center 其中justify-content是左右居中,align-items是上下居中
阅读全文
摘要:1.在子元素使用display:inline-block 注意子元素宽度加上边距不能超过父元素宽度,否则就在下一行展示 <style> #back{ border: red solid 1px; width: 800px; height: 500px; } #back div{ border: bl
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <script> function fun(){ //ajax核心xmlHttpRequest对象 var xhttp; if (w
阅读全文
摘要:<script type="text/javascript" src="js/jquery.js"></script> <script> function fun(){ $.ajax({ url:"ser1",//servlet路径 type:"post",//请求方式 默认get data:{ u
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title></title> <!-- Bootstrap 5 的设计目标是响应移动设备。移动优先的样式是核心框架的一部分。 为确保正确的渲染和触摸缩放,请在 <head>
阅读全文
摘要:什么是 AJAX? AJAX = Asynchronous JavaScript And XML. AJAX 并非编程语言。 AJAX 仅仅组合了: 浏览器内建的 XMLHttpRequest 对象(从 web 服务器请求数据) JavaScript 和 HTML DOM(显示或使用数据) Ajax
阅读全文
摘要:<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <script type="text/javascript" src="jquery.js"></script> <script type="text/javas
阅读全文
摘要:<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style type="text/css"> .father *{ display: block; border: 1px solid greenyellow;
阅读全文
摘要:<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> </title> <link rel="stylesheet" type="text/css" href="JQ_css.css"/> </head> <body> <div i
阅读全文
摘要:<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> </head> <body> <p id="p1">this is <b>p</b></p> <button type="button" id="btn1">cl
阅读全文
摘要:<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> </head> <body> <p id="p1">this is p</p> <button id="btn1" type="button">click</bu
阅读全文
摘要:<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style type="text/css"> #div1{ background-color: blueviolet; height: 100px; width
阅读全文

浙公网安备 33010602011771号