將swiper的 indicator-dots='true'刪掉,自己寫指示點(diǎn)代碼,當(dāng)swiper的current值等于循環(huán)圖片的最后一個(gè)值時(shí),將指示點(diǎn)的z-index改為-1
wxml:
wxss:
js:
效果:
最后一張圖的時(shí)候指示點(diǎn)隱藏,按鈕出現(xiàn)
app.get('/api/mes/get',function(req,res){
const wa = req.session.wa
if(!req.session.name){
res.json({code:100})//么登錄
return;
}else{
// 根據(jù)session中的name來(lái)查詢數(shù)據(jù)
db.limModel.findOne({name:req.session.name},(err,doc)=>{
//更新限制次數(shù)
var key = doc.getnum;
// key++
key++;
if(!err){
if(key<10){
// 根據(jù)session中的name來(lái)更新 getnum
db.limModel.update({name:req.session.name},{getnum:key},(e,d)=>{
if(!e){
//更新完成后,統(tǒng)計(jì)mesModel中條目數(shù)量
db.mesModel.find().count(function(err,num){
// 得到mesModel中的條目數(shù)量
var maxnum = num
if(!err){
// 隨機(jī)數(shù)生成方法
function ya(){
var randnum = Math.round(maxnum*Math.random());
// 判斷 session中的wa值 是否和randnum相等
if(wa.indexOf(randnum) == -1){
// 如果相等,添加值到wa數(shù)組中
wa.push(randnum)
console.log(randnum)
return randnum
}else{
return ya();
}
}
// 立即執(zhí)行,應(yīng)該得到一個(gè)隨機(jī)數(shù)的值
ya() // 第一次執(zhí)行
// 輸出最新的數(shù)組
console.log(req.session.wa)
// mesModel 中獲取數(shù)據(jù),并且跳過(guò)ya(); 這里已經(jīng)代碼有問(wèn)題,上面執(zhí)行過(guò)一次,這里又創(chuàng)建一個(gè)隨機(jī)數(shù)值。
db.mesModel.find().skip(ya()/*第二次執(zhí)行*/).limit(1).exec(function(err,doc){
const d1 = doc;
db.userDetailsModel.findOne({name:req.session.name},(e,d)=>{
if(!e){
res.json({d1,d})
}
});
})
}
})
}else{
console.log(e)
}
});
}else{
res.json({code:200})//每天10次
}
}else{
console.log(err)
}
})
}
})<li v-for="(children,index) in item.list" :class="index==1?'one':'two'"></li>
index==1這一塊對(duì)索引進(jìn)行判斷如果滿足條件添加one樣式,不滿足則是two,判斷語(yǔ)句和樣式換成自己想要的效果
這個(gè)你要看你 webapp外面打包那個(gè)殼子 有沒(méi)有給你提供“返回按鍵的”事件讓你去做。
或者說(shuō)你的h5頁(yè)面有沒(méi)有做成像瀏覽器回退一樣的效果,也就是說(shuō)你的頁(yè)面有路由。
要實(shí)現(xiàn)你想要的效果,就是要監(jiān)聽上面說(shuō)的“返回按鍵的事件”然后判斷你的頁(yè)面路由回退到根路由了,那就給出一個(gè)toast提示,再按一下推出app
對(duì)頁(yè)面使用@touchmove=“event”,解決了這個(gè)問(wèn)題
你那個(gè)鏈接不是已經(jīng)教你如何用了么
不知道你為什么要這樣做,只能說(shuō)個(gè)我認(rèn)為符合題意的答案
主要思路是當(dāng)比較到nth-of-type 或 class不同時(shí),直接去掉
// 首先將字符串按照>符合切割
const selector1="html>body>div.container>ul>li.item:nth-of-type(1)>a.active:nth-of-type(3)";
const selector2="html>body>div.container>ul>li.item:nth-of-type(2)>a:nth-of-type(3)"
const arr1 = selector1.split(/\s*\>\s*/);
const arr2 = selector2.split(/\s*\>\s*/);
// 假設(shè)分割后得到的數(shù)組長(zhǎng)度是一樣的
const text = arr1.map((item, index)=> {
if(arr2[index]!==item){
const child1 = item.split(/[\.\:]/);
const child2 = arr2[index].split(/[\.\:]/);
return child1.filter((item)=> child2.includes(item)).reduce((a, b)=> {
if(b.startsWith('nth-of-type')){
return a+':'+b;
}else{
return a+'.'+b;
}
})
}else{
return item;
}
}).join('>');
console.log(text)
純粹只是看到別人,遇到問(wèn)題就想到用正則可以解決,很不爽,強(qiáng)答一波.瞎寫的,懶的寫注釋,我自己都看不懂
$表示字符串的結(jié)尾,是特殊字符,使用RegExp的時(shí)候,需要使用兩個(gè)\\轉(zhuǎn)義:
const template = "the age of ${name} is ${age}";
const data = { name: "xiaoming", age: 8};
console.log(render(template, data));
// 輸出: "the age of xiaoming is 8"
function render(template,data) {
for (key in data) {
if(key) {
console.log(key);
var re = new RegExp("\\${"+key+"}");
// var re = "${" + key + "}"; // 這塊直接使用字符串就行,不用正則也可以
console.log(re,data[key]);
template = template.replace(re,data[key]);
// console.log("test:",template.replace("${name}","xiaoming"));
console.log(template);
}
}
}終于知道怎么弄了,于是來(lái)自問(wèn)自答:
首先安裝vetur,打開首選項(xiàng)-設(shè)置
加入2行
"prettier.tabWidth": 4,
"vetur.format.defaultFormatter.html": "prettier"已經(jīng)自己看著文檔實(shí)現(xiàn)了!
b[0]==a是因?yàn)閖Q包裝對(duì)象在存儲(chǔ)時(shí)會(huì)把原生DOM對(duì)象存儲(chǔ)在key[0]的位置(這個(gè)你console一下就很清楚了)不完全一樣但是原理相同,我已經(jīng)回答過(guò)一次了,去那邊看看吧:https://segmentfault.com/q/10...
我也遇到這個(gè)問(wèn)題,關(guān)注一下。
let arr = [];
let arr2 = [];
for(let i = 0,j=0; i < arr.length; i++){
(j+1)*10 === i && j++
arr2[j].push(arr[i]);
}
瞎寫的
已經(jīng)找到了,在 /home/gitlab-runner/目錄下
這是break的語(yǔ)法,和out無(wú)關(guān),這個(gè)可以取任意名字。只要這二個(gè)地方一致:out:{
for(var i = 0; i < 10; i++) {
if(i === 5) break `out`;
}
}
作用就是break結(jié)束循環(huán),然后跳轉(zhuǎn)到out: {...},繼續(xù)執(zhí)行之后的代碼。
用render props實(shí)現(xiàn)
官方文檔
//父組件
render() {
const props = Object.assign(
{...this._panResponder.panHandlers},
{style :{ backgroundColor: 'red'}}
)
return (
<View
style={{ backgroundColor: 'orange'... }}
>
{this.props.renderItem(props)}
</View>
)
}
子組件
<Gesture
renderItem={
props => (
<Image
source={{ uri: 'https:xxx.jpg' }}
{...props}
/>
)
}
/>http://php.net/manual/zh/mail...
$to = "someone@example.com"; // 郵件接收者
$subject = "參數(shù)郵件"; // 郵件標(biāo)題
$message = "Hello! 這是郵件的內(nèi)容。"; // 郵件正文
$from = "someonelse@example.com"; // 郵件發(fā)送者
$headers = "From:" . $from; // 頭部信息設(shè)置
mail($to,$subject,$message,$headers);
echo "郵件已發(fā)送";
2.也可以使用phpmailer發(fā)送
https://github.com/PHPMailer/...
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
//Load Composer's autoloader
require 'vendor/autoload.php';
$mail = new PHPMailer(true); // Passing `true` enables exceptions
try {
//Server settings
$mail->SMTPDebug = 2; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'smtp1.example.com;smtp2.example.com'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'user@example.com'; // SMTP username
$mail->Password = 'secret'; // SMTP password
$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 587; // TCP port to connect to
//Recipients
$mail->setFrom('from@example.com', 'Mailer');
$mail->addAddress('joe@example.net', 'Joe User'); // Add a recipient
$mail->addAddress('ellen@example.com'); // Name is optional
$mail->addReplyTo('info@example.com', 'Information');
$mail->addCC('cc@example.com');
$mail->addBCC('bcc@example.com');
//Attachments
$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
//Content
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = 'Here is the subject';
$mail->Body = 'This is the HTML message body <b>in bold!</b>';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
$mail->send();
echo 'Message has been sent';
} catch (Exception $e) {
echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo;
}nextTick
我記得bootstra-table顯示的都是JSON數(shù)據(jù)
,你可以試試接送數(shù)據(jù)
北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國(guó)IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國(guó)家
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國(guó)一站式人才培養(yǎng)平臺(tái)、一站式人才輸送平臺(tái)。2014年4月3日在美國(guó)成功上市,融資1
北大課工場(chǎng)是北京大學(xué)校辦產(chǎn)業(yè)為響應(yīng)國(guó)家深化產(chǎn)教融合/校企合作的政策,積極推進(jìn)“中國(guó)制造2025”,實(shí)現(xiàn)中華民族偉大復(fù)興的升級(jí)產(chǎn)業(yè)鏈。利用北京大學(xué)優(yōu)質(zhì)教育資源及背
博為峰,中國(guó)職業(yè)人才培訓(xùn)領(lǐng)域的先行者
曾工作于聯(lián)想擔(dān)任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項(xiàng)目經(jīng)理從事移動(dòng)互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
浪潮集團(tuán)項(xiàng)目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺(tái)面向?qū)ο箝_發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫(kù),具有快速界面開發(fā)的能力,對(duì)瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁(yè)制作和網(wǎng)頁(yè)游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國(guó)Software AG 技術(shù)顧問(wèn),美國(guó)Dachieve 系統(tǒng)架構(gòu)師,美國(guó)AngelEngineers Inc. 系統(tǒng)架構(gòu)師。