如何解决对于样式加载器,styleTag和lazyStyleTag之间是否存在混合方法?
我正在尝试使用function send_calendar_invite ($to,$str_cc,$str_bcc,$subject,$body,$from_addr,$from_name,$from_password,$meeting_date,$meeting_duration,$meeting_location)
{
if($str_cc!='')
{
$cc_addr=explode(",",$str_cc);
$cc_cnt=count($cc_addr);
}
if($str_bcc!='')
{
$bcc_addr=explode(",$str_bcc);
$bcc_cnt=count($bcc_addr);
}
$to_addr = explode(",$to);
$to_cnt=count($to_addr);
//Convert MysqL datetime and construct iCal start,end and issue dates
$meetingstamp = strtotime($meeting_date. " UTC");
$dtstart= gmdate("Ymd\THis",$meetingstamp);
$dtend= gmdate("Ymd\THis",$meetingstamp+$meeting_duration);
$todaystamp = gmdate("Ymd\THis");
//Create unique identifier
$cal_uid = date('Ymd').'T'.date('His')."-".rand()."@outlook.com";
//Create Email Headers
$headers = "From: ".$from_name." <".$from_addr.">\n";
$headers .= "Reply-To: ".$from_name." <".$from_addr.">\n";
//Create Email Body (HTML)
$message = '';
$message .= "<html>\n";
$message .= "<body>\n";
$message .= '<p>Hi All,</p>';
$message .= $body;
$message .= "</body>\n";
$message .= "</html>\n";
//Create ICAL Content (Google rfc 2445 for details and examples of usage)
$ical = 'BEGIN:VCALENDAR' . "\r\n" .
'PRODID:-//Microsoft Corporation//Outlook 10.0 MIMEDIR//EN' . "\r\n" .
'VERSION:2.0' . "\r\n" .
'METHOD:REQUEST' . "\r\n" .
'BEGIN:VTIMEZONE' . "\r\n" .
'TZID:Eastern Standard Time' . "\r\n" .
'BEGIN:STANDARD' . "\r\n" .
'DTSTART:16011104T020000' . "\r\n" .
'RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=11' . "\r\n" .
'TZOFFSETFROM:-0400' . "\r\n" .
'TZOFFSETTO:-0500' . "\r\n" .
'TZNAME:Eastern Standard Time' . "\r\n" .
'END:STANDARD' . "\r\n" .
'BEGIN:DAYLIGHT' . "\r\n" .
'DTSTART:16010311T020000' . "\r\n" .
'RRULE:FREQ=YEARLY;BYDAY=2SU;BYMONTH=3' . "\r\n" .
'TZOFFSETFROM:-0500' . "\r\n" .
'TZOFFSETTO:-0400' . "\r\n" .
'TZNAME:Eastern Standard Time' . "\r\n" .
'END:DAYLIGHT' . "\r\n" .
'END:VTIMEZONE' . "\r\n" .
'BEGIN:VEVENT' . "\r\n" .
'ORGANIZER;CN="'.$from_name.'":MAILTO:'.$from_addr. "\r\n";
for($i=0;$i<$to_cnt;$i++)
{
$ical .='ATTENDEE;CN="'.$to_addr[$i].'";ROLE=REQ-PARTICIPANT;RSVP=TRUE:MAILTO:'.$to_addr[$i]. "\r\n";
}
$ical .='LAST-MODIFIED:' . date("Ymd\TGis") . "\r\n" .
'UID:'.date("Ymd\TGis",strtotime($startTime)).rand()."@outlook.com \r\n" .
'DTSTAMP:'.date("Ymd\TGis"). "\r\n" .
'DTSTART;TZID="Eastern Standard Time":'.$dtstart. "\r\n" .
'DTEND;TZID="Eastern Standard Time":'.$dtend. "\r\n" .
'TRANSP:OPAQUE'. "\r\n" .
'SEQUENCE:1'. "\r\n" .
'SUMMARY:' . $subject . "\r\n" .
'LOCATION:' . $meeting_location . "\r\n" .
'CLASS:PUBLIC'. "\r\n" .
'PRIORITY:5'. "\r\n" .
'BEGIN:VALARM' . "\r\n" .
'TRIGGER:-PT15M' . "\r\n" .
'ACTION:disPLAY' . "\r\n" .
'DESCRIPTION:Reminder' . "\r\n" .
'END:VALARM' . "\r\n" .
'END:VEVENT'. "\r\n" .
'END:VCALENDAR'. "\r\n";
$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 = 'smtp.office365.com'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = $from_addr; // SMTP username
$mail->Password = $from_password; // SMTP password
$mail->SMTPSecure = 'tls'; // Enable TLS encryption,`ssl` also accepted
$mail->Port = 587; // TCP port to connect to
//Recipients
$mail->setFrom($from_addr,$from_name);
for($i=0;$i<$to_cnt;$i++)
{
$mail->addAddress(trim($to_addr[$i]));
}
$mail->addReplyTo($from_addr,$from_name);
if($cc_cnt>=0)
{
for($i=0;$i<$cc_cnt;$i++)
{
//echo $cc_addr[$i] . "test";
$mail->addCC(trim($cc_addr[$i]));
}
}
if($bcc_cnt>=0)
{
for($i=0;$i<$bcc_cnt;$i++)
{
$mail->addBCC(trim($bcc_addr[$i]));
}
}
//Content
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = $subject;
$mail->Body = $message;
$mail->AltBody = $message;
$mail->AddStringAttachment("$ical","meeting.ics","base64","text/calendar; charset=utf-8; method=REQUEST");
$mail->send();
//echo 'Message has been sent';
return "sent";
} catch (Exception $e) {
//echo 'Message Could not be sent.';
//echo 'Mailer Error: ' . $mail->ErrorInfo;
return "Failed";
}
}
中的injectType: lazyStyleTag
选项来支持我们不同的CSS主题。组件库和应用程序中的组件只有一个Less文件,最终(通过内部管道)生成多个CSS文件-每个主题一个。我可以将style-loader
与injectType: lazyStyleTag
和require.context
/ use
函数结合使用,以支持为给定主题使用正确的CSS文件(通过主题上下文)。我看到的问题是一个FOUC,因为unuse
在服务器端渲染中没有任何意义,因此在页面首次加载然后快速刷新后,require.context
不会由webpack自动加载样式的style-loader
函数正确设置样式。
我想知道是否有一种方法可以支持在服务器端渲染过程中加载正确的主题CSS文件,或者是否存在同时使用use
和 {{ 1}}。使用styleTag
选项加载初始主题CSS文件,然后使用lazyStyleTag
加载替代主题CSS文件。
任何想法或帮助都非常感谢!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。