export default Helper;
按理說(shuō)你的代碼,正常運(yùn)行是會(huì)監(jiān)聽(tīng)8090端口。
但是你說(shuō)沒(méi)有監(jiān)聽(tīng)這個(gè)8090端口,那么很大的可能性是你應(yīng)用的其他地方有編程式的dev-server。
編程式的優(yōu)先級(jí)大于配置式
紙上得來(lái)終覺(jué)淺 絕知此事要躬行
好好的做幾個(gè)項(xiàng)目吧。做的多了,記得也就牢了。
建議對(duì)于這種嵌有HTML的內(nèi)容 通過(guò)使用模板文件
進(jìn)行存儲(chǔ),使用占位符
的形式來(lái)對(duì)內(nèi)容進(jìn)行替換
。
<html>
<head>
{$phpmailer_css_style}
</head>
<body>
<div class="edm-layout">
<img src="{$host_url}images/logo.png">
<div class="line"></div>
</div>
<div class="edm-content">
<div class="edm-hithere">
嗨,{$user_name} <br>XXX {$prod_total}XXXXX<br>XXXXXX{$this_total} XXX
</div>
<div class="edm-products">
{$row_distinct}
</div>
</div>
</div>
</body>
</html>
<?php
$php_version = version_compare(phpversion(), '7');
/**
* 必須php 7
*/
if ($php_version === -1) {
die('Need a high version of php 7.1.*');
}
/**
* EmailTemplate
*/
class EmailTemplate
{
/**
* @param string $template_path 模板路徑
* @param array $args 變量組
* @return string 渲染后的
* @throws Exception
*/
public static function render(string $template_path, array $args): string
{
if (!file_exists($template_path)) {
throw new Exception("Not found template fiel.", 1);
}
$template = file_get_contents($template_path);
$result = preg_replace_callback('!\{\$(\w+)\}!', function ($matches) use ($args) {
$arg = $matches[1];
return $args[$arg] ?? '';
}, $template);
return $result;
}
}
$body = EmailTemplate::render(
'email.template',
[
'host_url' => 'http://xxx',
'phpmailer_css_style' => 'empty',
'user_name' => '張三',
'prod_total' => '100.00',
'this_total' => '10000.00',
'row_distinct' => 'empty',
]
);
這樣就實(shí)現(xiàn)了一個(gè)簡(jiǎn)單的模板替換。
這樣?
<script>
$('table tr').click(function () {
$(this).find('td').addClass('redcolor');
$(this).siblings().find('td').removeClass('redcolor');
})
</script>
<style>
.redcolor{
color: red
}
</style>
就是搞一個(gè)方法遍歷數(shù)組,然后如果有children
就再用children
調(diào)用一次,所有出現(xiàn)過(guò)的數(shù)據(jù)都push到一個(gè)地方,最后輸出這個(gè)結(jié)果。
str="ADMIN,27cfb184cba7497f8bc34af8d228b988,712803a9c33e4110961ed40a113db874,0747714bf99b4cf2919ee73eb4ac7662".split(',');
((_list)=>{
var arr = [];
var _fun = (__arr)=>{
__arr.forEach(v=>{
if(!!~str.indexOf(v.id)) arr.push({label:v.text,value:v.id})
if(v.children.length) _fun(v.children)
});
}
_fun(_list);
return arr
})([
{
"id": "ADMIN",
"checked": false,
"text": "數(shù)據(jù)中心",
"leaf": true,
"priority": -1,
"children": []},{"id": "27cfb184cba7497f8bc34af8d228b988",
"checked": false,
"text": "貸后管理",
"leaf": false,
"priority": 123,
"children": [
{
"id": "898f63e4fc144dc19abd973a403645e6",
"checked": false,
"text": "法律公司",
"leaf": true,
"priority": 123,
"children": []
},
{
"id": "aa5f74be66f04e62bbcea34717133624",
"checked": false,
"text": "墊息部",
"leaf": true,
"priority": 123,
"children": []
},
{
"id": "bada5b2760ab4e879f9d7200536917b6",
"checked": false,
"text": "催討部",
"leaf": true,
"priority": 123,
"children": []
},
{
"id": "cb781db8f4e84ad7b0570eca9960a954",
"checked": false,
"text": "合同管理部",
"leaf": true,
"priority": 1,
"children": []}]},{"id": "f3cdf3e6949b49c19b624eee6a08f0e8",
"checked": false,
"text": "業(yè)務(wù)部",
"leaf": false,
"priority": 123,
"children": [
{
"id": "0747714bf99b4cf2919ee73eb4ac7662",
"checked": false,
"text": "業(yè)務(wù)二部",
"leaf": true,
"priority": 123,
"children": []
},
{
"id": "712803a9c33e4110961ed40a113db874",
"checked": false,
"text": "業(yè)務(wù)一部",
"leaf": true,
"priority": 123,
"children": []
}
]}])
1.方法定義寫(xiě)的有問(wèn)題 function(){} -- 少了括號(hào)
2.一般不直接這么做,更改樣式什么的一般通過(guò)移除or添加class進(jìn)行
mysql編碼設(shè)置下utf-8
你這個(gè)會(huì)處理所有請(qǐng)求,但是 option 請(qǐng)求是不能設(shè)置 Content-Type 頭部的. 你得為 option 請(qǐng)求單獨(dú)的設(shè)置 cors 頭, 然后為正常請(qǐng)求設(shè)置 Content-Type 頭返回響應(yīng).
個(gè)人覺(jué)得應(yīng)該是路由配置那里的問(wèn)題,記得之前翻vue文檔的時(shí)候,路由配置有兩種模式,一種是默認(rèn)的hash模式,另一種就是mode:'history'模式,這個(gè)需要后臺(tái)配置支持,沒(méi)見(jiàn)過(guò)base這種寫(xiě)法。
用方法3,同時(shí)把操作抽成函數(shù),cwr和cdm都調(diào)用一次
后端簡(jiǎn)化下接口,就做成一個(gè)接口
用了 transition 的話,在切換路由的時(shí)候,兩個(gè)頁(yè)面會(huì)同時(shí)存在于文檔中,所以出現(xiàn)你說(shuō)的現(xiàn)象。
讓他們層疊起來(lái)就好了唄。
.fade-enter-active, .fade-leave-active {
transition: opacity .5s;
position: absolute;
top: 0;
left: 0;
}
不卸載小程序的話,下一次點(diǎn)擊不會(huì)彈出,可以使用wx.openSetting來(lái)設(shè)置
官網(wǎng)說(shuō)的webpack.base.conf.js
應(yīng)該這么干呀:
{
test: /\.js$/,
loader: 'babel-loader',
- include: [resolve('src'), resolve('test')]
+ include: [resolve('src'), resolve('test'), resolve('node_modules/vue-awesome')]
}
不太懂你的做法.
raw:文件內(nèi)容。
blame:按行顯示最新提交的信息。
history:文件的歷史記錄。
北大青鳥(niǎo)APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國(guó)IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國(guó)家
北大青鳥(niǎo)中博軟件學(xué)院創(chuàng)立于2003年,作為華東區(qū)著名互聯(lián)網(wǎng)學(xué)院和江蘇省首批服務(wù)外包人才培訓(xùn)基地,中博成功培育了近30000名軟件工程師走向高薪崗位,合作企業(yè)超4
中公教育集團(tuán)創(chuàng)建于1999年,經(jīng)過(guò)二十年潛心發(fā)展,已由一家北大畢業(yè)生自主創(chuàng)業(yè)的信息技術(shù)與教育服務(wù)機(jī)構(gòu),發(fā)展為教育服務(wù)業(yè)的綜合性企業(yè)集團(tuán),成為集合面授教學(xué)培訓(xùn)、網(wǎng)
達(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
曾工作于聯(lián)想擔(dān)任系統(tǒng)開(kāi)發(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ū)ο箝_(kāi)發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫(kù),具有快速界面開(kāi)發(fā)的能力,對(duì)瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁(yè)制作和網(wǎng)頁(yè)游戲開(kāi)發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開(kāi)發(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)師。