搜索结果

  • 自定义指令基本用法

    <body> <div id="app"> <input type="text" v-focus> <input type="text"> </div> <script type="text/javascript" src="js/vue.js"></script> <script type="text/javascript"> /* 自定义指令 */ Vue.directive('focus', { inserted: function(el){ // el表示指令所绑定的元素 el.focus(

  • 表单域修饰符用法

    <body> <div id="app"> <input type="text" v-model.number='age'> <input type="text" v-model.trim='info'> <input type="text" v-model.lazy='msg'> <div>{{msg}}</div> <button @click='handle'>点击</button> </div> <script type="text/javascript" sr

  • 表单基本操作

    <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title> <style type="text/css"> form div { height: 40px; line-height: 40px; } form div:nth-child(4) { height: auto; } form div span:first-child { display: inline-block; width: 100px

  • Ajax请求案例

    1 表单内容<form method="post" class="J_ajaxForms" name="form1"> <div class="info"> <ul class="mycol mycol-3 clearfix"> <li class="col"><input name="name" id="name" type="text" placeholder="您的姓名:"></li> <li class="col"><input name="phone" id="phone" type="text

  • 多个栏目的查询结果合并

    1 先自定义二维数组排序函数function erarray_sort($arr, $keys, $type='asc'){ $keysvalue = $new_array = array(); foreach ($arr as $k=>$v){ $keysvalue[$k] = $v[$keys]; } if($type == 'asc'){ asort($keysvalue); }else{ arsort($keysvalue); } reset($keysvalue); foreach ($keysvalue as $k=>$v){ $new_array[$k] = $arr

  • 分页列表功能和详情功能

    // 列表public function index(){ // 分类 $cate_id = input('cate_id',''); $base = Db::name('base') -> where('is_show',1) -> where('base_category_id', $cate_id) -> order('show_time desc,id desc') -> paginate(16, false, ['query' => ['cate_id' => $cate_id, 'page' => request()->param('

  • 获取当前的模块控制器和操作名

    1 方法15.0版本取消了原来的代表当前模块、控制器和操作名的常量,如果需要获取这些,可以改成:当前模块名 :request()->module();当前控制器名:request()->controller();当前操作名:request()->action();2 方法2如果需要在模板里面输出,则可以使用:{$Request.module}{$Request.controller}{$Request.action}

  • 百度地图基本用法

    1 首先,编写页面结构<div class="contact-map" id="map"></div>2 接着,创建百度地图的样式文件SearchInfoWindow_min.css,并在需要用到百度地图的网页中引入该文件,文件的内容如下:(复制粘贴即可).BMapLib_SearchInfoWindow{font:12px arial,宋体,sans-serif;position:absolute;border:1px solid #999;background-color:#fff;cursor:default}.BMapLib_SearchInfoWindow f

  • 阿里云部署LNMP环境

    1.准备工作实例已分配公网IP地址或绑定弹性公网IP(EIP)。操作系统必须为CentOS 7.x。实例安全组的入方向规则已放行22、80、443端口。2.环境说明Nginx版本:Nginx 1.20.1MySQL版本:MySQL 5.7.42PHP版本:PHP 7.0.333.搭建环境步骤1:关闭防火墙和SELinux# 1.查看当前防火墙的状态# 如果防火墙的状态参数是inactive,则防火墙为关闭状态# 如果防火墙的状态参数是active,则防火墙为开启状态systemctl status firewalld# 2.临时关闭防火墙sudo systemctl stop firewall

  • 选项卡案例

    1 代码:<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title> <style type="text/css"> .tab ul { overflow: hidden; padding: 0; margin: 0; } .tab ul li { box-sizing: border-box; padding: 0; float: left; width: 100px; height: 45px; l

  • 循环结构-遍历对象

    <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title> </head><body> <div id="app"> <div v-if='v==13' v-for='(v,k,i) in obj'>{{v + '---' + k + '---' + i}}</div> </div> <script type="text/javascri

  • 循环结构-遍历数组

    <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title> </head><body> <div id="app"> <div>水果列表</div> <ul> <li v-for='item in fruits'>{{item}}</li> <li v-for='(item, index) in fruits'&g

  • 分支结构

    <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title> </head><body> <div id="app"> <div v-if='score>=90'>优秀</div> <div v-else-if='score<90&&score>=80'>良好</div> <div v-else

  • 样式绑定之style绑定用法

    <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title> </head><body> <div id="app"> <div v-bind:style='{border: borderStyle, width: widthStyle, height: heightStyle}'></div> <div v-bind:style='objStyles

  • 样式绑定之class绑定3个细节用法

    <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title> <style type="text/css"> .active { border: 1px solid red; width: 100px; height: 100px; } .error { background-color: orange; } .test { color: blue; } .base { font-size: 28px;

  • 样式绑定之class绑定数组用法

    <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title> <style type="text/css"> .active { border: 1px solid red; width: 100px; height: 100px; } .error { background-color: orange; } </style></head><body> <div

  • 样式绑定之class绑定对象用法

    <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title> <style type="text/css"> .active { border: 1px solid red; width: 100px; height: 100px; } .error { background-color: orange; } </style></head><body> <div

  • v-model指令的本质

    <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title></head><body> <div id="app"> <div>{{msg}}</div> <input type="text" v-bind:value="msg" v-on:input='handle'> <input type="text" v-bind:value="m

  • 属性绑定基本用法

    <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title></head><body> <div id="app"> <a v-bind:href="url">百度</a> <a :href="url">百度1</a> <button v-on:click='handle'>切换</button> </d