手机浏览 RSS 2.0 订阅 膘叔的简单人生 , 腾讯云RDS购买 | 超便宜的Vultr , 注册 | 登陆
浏览模式: 标准 | 列表查看gouki的文章

antv的 dialog 如何去掉边框

 在用 antv 的 modal 对话框时,你会发现弹出来的框有一个很大的边框,打开 css 会找到 ant-modal-content 这个 class。如果你直接 加这个样式 padding: 0,或者 :deep(.ant-modal-content){padding: 0 }你会发现都不起作用

即使,即使你用了 important 也还是不起作用
 
这时候 看浏览器工具栏的右侧,会有类似 :where(xxxx) .ant-modal-content 这样的样式,也就是说他本身就是一个伪类,如果你直接对它操作是不起作用的。
 
网上找了很多资料。最后找到说,其实他有一个 wrap-class-name 的属性。用了这个属性后,整个对话框里的样式就可以跟着这个外层类走了。因此设定:<a-modal wrap-class-name="wrap-modal" ></a-modal>
再添加样式:
XML/HTML代码
  1. .wrap-modal{  
  2.   .ant-modal-content{  
  3.     padding: 0!important;  
  4.   }  
  5. }  
再次看弹窗。一切正常啦 ~
 

CSS如何给文字加上文字一半高度的背景色

 一般来说象这种效果实现还是比较有意思的

在文字下层加上一定高度的背景色,半透明,而且模糊。。。
 
话不多说,上代码:
CSS代码
  1. .text_bg {  
  2.   displayinline-block;  
  3.   positionrelative;  
  4.   z-index: 1;  
  5. }  
  6.   
  7. .text_bg::after {  
  8.   content'';  
  9.   positionabsolute;  
  10.   bottom: 0;  
  11.   left: 0;  
  12.   width: 100%;  
  13.   height: 40%;  
  14.   background-color#B6D16F;  
  15.   opacity: .7;  
  16.   z-index: -1;  
  17.   filter: blur(1px); /* 可选:模糊效果 */  
  18. }  
上述代码中最重要的其实就是那两个z-index。否则你会发现背景色其实压在了文字上方。
其他的基本上都是基本操作,只是额外用了一个:after的伪类。在当前这个例子里。用before和after的最终显示效果其实是一样的
 
 
 

unoconv中文不正常的解决方案

 用unoconv将wod转成pdf的时候,中文乱码,这时候解决方案往往是上传中文字体到系统库并注册即可。

中文字体网上下载的地方一堆堆的,就不再赘叙了。
 主要就是注册 ,因为用到了mkfontscale之类的命令。但这不是系统自带的,需要安装,因为我用debian。于是:
XML/HTML代码
  1. # 使mkfontscale和mkfontdir命令正常运行  
  2. sudo apt-get install ttf-mscorefonts-installer  
  3. # 使fc-cache命令正常运行  
  4. sudo apt-get install fontconfig  
然后在相应的字体目录下运行 
mkfontscale
mkfontdir
fc-cache -fv        //更新字体缓存 
fc-list :lang-zh
然后一切正常
 

有时候你不得不说,CF还是挺不错的

 之前还在说用了CF后,连垃圾评论都没了。

结果,一通电话过来。说如果你再用CF,把IP指在国外,就直接取消备案了。然而CF国内版又用不起,也看了一下怎么个国内加速,还是有点繁琐,所以还是先暂时禁用吧。
其实用CF做代理的时候 ,还能享受直接https,现在我还得自己再配https。真烦人
而且,又开始收到垃圾评论了。
 
忍忍吧

expect: spawn id exp3 not open

在尝试使用 envoy  尝试自动部署的时候,遇到了问题,即:如果我要自己创建一个新的域名,那只能上线去执行 lnmp vhost add 的命令。

为什么要使用 lnmp 呢?其实他对我的作用只有一个,多版本的 PHP。因为现在在线上,各种不同版本的 PHP 都在跑,有 PHP5.6 / PHP7.1 / PHP8.1估计后面还会有更多的版本。
 
于是,我就想着用 expect 来处理

sudo /usr/bin/expect<<EOF
spawn lnmp vhost add
expect {
    "Please enter domain" {send "{{$host}}\n";exp_continue}
    "Enter more domain name"  {send "\n";exp_continue}
    "Please enter the directory" {send "\n";exp_continue}
    "Allow Rewrite rule" {send "y\n";exp_continue}
    "Default rewrite" {send "laravel\n";exp_continue}
    "Enable PHP Pathinfo" {send "\n";exp_continue}
    "Allow access log" {send "\n";exp_continue}
    "Enable IPv6" {send "\n";exp_continue}
    "Enter your choice " {send "\n";exp_continue}
    "Add SSL Certificate" {send "\n";exp_continue}
    "Press any key to start" {send "\r"; exp_continue}
}
expect eof
EOF
但执行后一直报错:
[mpass]: expect: spawn id exp3 not open
[mpass]: while executing
[mpass]: "expect eof"
 
仔细查了半天,原来最后一句还用了 exp_continue。。expect 认为还没有执行完。所以。就行报错了。
将最后一个 exp_contiue 删除。再次执行,就正常了
XML/HTML代码
  1. @task('lnmp' ,['on'=>'dev'])  
  2.   
  3. @if($force)  
  4.     sudo rm -rf /usr/local/nginx/conf/vhost/{{$host}}.conf  
  5.     sudo rm -rf /home/wwwroot/{{$host}}  
  6. @endif  
  7. sudo /usr/bin/expect<<EOF  
  8. spawn lnmp vhost add  
  9. expect {  
  10.     "Please enter domain" {send "{{$host}}\n";exp_continue}  
  11.     "Enter more domain name"  {send "\n";exp_continue}  
  12.     "Please enter the directory" {send "\n";exp_continue}  
  13.     "Allow Rewrite rule" {send "y\n";exp_continue}  
  14.     "Default rewrite" {send "laravel\n";exp_continue}  
  15.     "Enable PHP Pathinfo" {send "\n";exp_continue}  
  16.     "Allow access log" {send "\n";exp_continue}  
  17.     "Enable IPv6" {send "\n";exp_continue}  
  18.     "Enter your choice " {send "\n";exp_continue}  
  19.     "Add SSL Certificate" {send "\n";exp_continue}  
  20.     "Press any key to start" {send "\r";}  
  21. }  
  22. expect eof  
  23. EOF  
  24. ls -lah /home/wwwroot/  
  25. @endtask  
这样就 OK 了

Tags: envoy, expect

Records:304012345678910»