A simple table having its header fixed on scroll with JQuery.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const checkTime = (rule, value, callback) => { | |
if (!value) { | |
return callback(new Error('时间不能为空')); | |
} | |
setTimeout(() => { | |
console.log(value) | |
if (!Number.isInteger(value * 1)) { | |
callback(new Error('请输入整数值')); | |
} else { | |
callback() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const checkTime = (rule, value, callback) => { | |
if (!value) { | |
return callback(new Error('时间不能为空')); | |
} | |
setTimeout(() => { | |
if (!Number.isInteger(value)) { | |
callback(new Error('请输入数字值')); | |
} else { | |
callback() | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
submitForm (formName) { | |
this.$refs[formName].validate((valid) => { | |
if (valid) { | |
DetectorService.setSSHConfig(this.formData).then( | |
(res) => { | |
if (res.errcode === '0') { | |
this.$message({ | |
message: 'SSH配置成功', | |
type: 'success', | |
duration: '1500' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="content"> | |
<div class="content-inner"> | |
<el-form :model="formData" status-icon :rules="rules" ref="myForm" label-width="100px" class="demo-ruleForm"> | |
<el-form-item label="IP" prop="server_ip"> | |
<el-input v-model="formData.server_ip"></el-input> | |
</el-form-item> | |
<el-form-item label="用户名" prop="username"> | |
<el-input v-model="formData.username"></el-input> | |
</el-form-item> | |
<el-form-item label="密码" prop="password"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const checkIp = (rule, value, callback) => { | |
if (!value) { | |
return callback(new Error(`服务器IP不能为空`)) | |
} | |
let regIp = /^((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)$/ | |
let status = regIp.test(value) | |
if (!status) { | |
callback(new Error('IP格式错误')) | |
} else { | |
callback() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class ViewController: UIViewController { | |
@IBOutlet weak var sc1: UISegmentedControl! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view, typically from a nib. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).on('mouseup', function(e) { | |
if(!shareAddChanceTip.is(e.target) && shareAddChanceTip.has(e.target).length === 0){ | |
shareAddChanceTip.hide(); | |
} | |
if(!appAddChanceTip.is(e.target) && appAddChanceTip.has(e.target).length === 0){ | |
appAddChanceTip.hide(); | |
} | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//连接数据库 | |
mysql_connect('127.0.0.1', 'code1', ''); | |
mysql_select_db('code1'); | |
mysql_query("set names 'utf8'"); | |
//预设数据以便进行更新操作 | |
mysql_query("insert into user(name, age, class) values('王二', 19, '高三五班')"); | |
$id = mysql_insert_id(); | |
//在这里更新id为$id的行的名字为李白 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$link = mysql_connect('127.0.0.1', 'code1', '') or die('数据库连接失败'); | |
mysql_select_db('code1'); | |
mysql_query("set names 'utf8'"); | |
$result = mysql_query('select * from user limit 1'); | |
$row = mysql_fetch_array($result); | |
print_r($row); | |
PDO扩展 |
NewerOlder