对于样式加载器,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-loaderinjectType: lazyStyleTagrequire.context / use函数结合使用,以支持为给定主题使用正确的CSS文件(通过主题上下文)。我看到的问题是一个FOUC,因为unuse在服务器端渲染中没有任何意义,因此在页面首次加载然后快速刷新后,require.context不会由webpack自动加载样式的style-loader函数正确设置样式。

我想知道是否有一种方法可以支持在服务器端渲染过程中加载正确的主题CSS文件,或者是否存在同时使用use {{ 1}}。使用styleTag选项加载初始主题CSS文件,然后使用lazyStyleTag加载替代主题CSS文件。

任何想法或帮助都非常感谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...