bootstrap-select插件, 怎么获取当前选中的值
$('.selectpicker').selectpicker('val')
在事件监听函数中使用$(this).val()
//举个例子
$('.selectpicker').on('changed.bs.select', function (e, clickedIndex, isSelected,previousValue) { const selectedVal = $(this).val();
}
$('.selectpicker').selectpicker('val')
在事件监听函数中使用$(this).val()
//举个例子
$('.selectpicker').on('changed.bs.select', function (e, clickedIndex, isSelected,
previousValue) { const selectedVal = $(this).val();
}
最近使用composer发现报如下错误:
`
[Composer\Downloader\TransportException]
The "https://packagist.org/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
`
1: 下载certificate:
cd ~ && wget http://curl.haxx.se/ca/cacert.pem --no-check-certificate
2: Export it:
export COMPOSER_CAFILE='~/cacert.pem'
这个路径必需是第一步下载文件的位置
3: Run composer:
composer install
from: https://github.com/composer/composer/issues/3346#issuecomment-285460207
memcahche不像redis那样有ttl命令可以直接查看key的过期时间.不过通过操作开始实现.
1 stats items
该命令输出的结果会类似如下:STAT items:1:number 66
其中1,就是slab_id, 66表示在slab为1下有key 66个.
2 stats cachedump slab_id count
(count表示一次显示几个,0表示全部显示)
该命令会输出结果每行会类似如下:ITEM abc [100 b; 1528336485 s]
其中键名abc, 占用100byte, 过期时间1528336485(unix时间戳形式)