【vue2】vue css样式篇之组件样式不生效?使用穿透样式即可
是不是很奇怪,部分写好的绑定样式运行后发现没生效!!然后打开控制台发现标签根本没有找到对应的类样式由于vue内部的打包机制原因,这个问题需要涉及到一个知识点,那就是“穿透样式”穿透样式是什么我们就不bb了,直接上代码你就懂了穿透样式有三种写法,都是在需要作为穿透样式的样式类前面加上特定的字符即可由于vue和vue-loader等组件的版本兼容性不一样,写法也就不一样,主要就下面三种
是不是很奇怪,部分写好的绑定样式运行后发现没生效!!然后打开控制台发现标签根本没有找到对应的类样式由于vue内部的打包机制原因,这个问题需要涉及到一个知识点,那就是“穿透样式”穿透样式是什么我们就不bb了,直接上代码你就懂了穿透样式有三种写法,都是在需要作为穿透样式的样式类前面加上特定的字符即可由于vue和vue-loader等组件的版本兼容性不一样,写法也就不一样,主要就下面三种
今天在写一个功能的时候,用到数据模型时出现如下报错该意思通俗讲就是访问数组中不存在的字段!
在实现具体功能的php代码之前,我们需要先了解一个组件库,ffmpeg-php首先php本身是无法获取视频和音频文件的信息,需要通过这个ffmpeg组件库调用php底层的程序来获取下面开始安装ffmpeg-php到thinkphp项目中!
1.Chinese(Simplified)(简体中文)Language 2.JS-CSS-HTMLFormatter 3.vue 4.VueLanguageFeatures5.Vue2Snippets6.Vetur
前端在部分业务下会有一种场景,需要修改某个对象单独的属性或值且修改后立即生效(如页面缓存、样式布局DIY调整配置),当这个对象是3维或者3维以上时,且传参的数据不一致,如果配置项较多,死方法就是每个对象都去一遍(比较愚蠢的写法)这个时候的代码量就比较多,那么如何减少这个代码量呢??下面我就写了一个函数,可以通过固定代码即可达到减少代码量const setValue = function(data, key, value) { if ('object' !== typeof data) { return null } if (key.indexOf('.') > 0) { let index1 = key.split('.')[0]; let index2 = key.replace(new RegExp('^' + index1 + '\.', 'g'), ''); if (data.hasOwnProperty(index1)) { data[index1] = setValue(data[index1], index2, value); } return data; } else { if (data.hasOwnProperty(key)) { data[key] = value } return data }}
运行npminstall报错解决方法npm ERR! code ENOENTnpm ERR! syscall spawn gitnpm ERR! path gitnpm ERR! errno -4058npm ERR! enoent Error while executing:npm ERR! enoent undefined ls-remote -h -t ssh://git@github.com/sohee-lee7/Squire.gitnpm ERR! enoentnpm ERR! enoentnpm ERR! enoent spawn git ENOENTnpm ERR! enoent This is related to npm not being able to find a file.npm ERR! enoentnpm ERR! A complete log of this run can be found in:npm ERR! D:\node\node_cache_logs\2020-09-01T01_09_19_309Z-debug.log
通过用户反馈服务器在使用时,如果网站过多或者并发过大,php自带的session可能会失效于是就有个了这个数据库版本,模拟session功能,今天把主要逻辑代码分享出来注意:代码中的DB类如果和你的程序不兼容需要自己改一下哦// +----------------------------------------------------------------------// | Nmae:Session数据库版 根据cookie生成设备标识,可替换本地服务器session过多出错问题// +----------------------------------------------------------------------// | Author: 沉梦执于梦 857285711 <blog.chenmyun.com>// +----------------------------------------------------------------------// | Date: 2020/10/16// +----------------------------------------------------------------------class Session{ /** * 设置Session * @param [type] $name [description] * @param [type] $value [description] * @param [type] $expire [description] */ public static function set($name, $value, $expire = null) { global $DB; $userid = self::getUserId(); if ($expire === null || $expire < time()) { $expire = time() + 3600; } try { $row = $DB->get_row("SELECT * FROM `auth_session` WHERE u= ? and k= ? limit 1", [$userid, $name]); if ($row != false && isset($row['id'])) { $data = [$value, $expire, $row['id']]; return $DB->query("UPDATE `auth_session` SET v= ?, e= ? WHERE `id`= ?", $data); } else { $sql = "INSERT INTO `auth_session` (`u`,`k`,`v`,`e`) VALUES (?, ?, ?, ?)"; $data = [$userid, $name, $value, $expire]; if ($DB->query($sql, $data)) { return true; } throw new \PDOException($DB->error()); } } catch (\PDOException $e) { die('数据库错误:' . $e->getMessage()); } catch (\Exception $e) { die('系统错误:' . $e->getMessage()); } } /** * 获取session * @param string $name session名称 * @return string */ public static function get($name = 'userid') { global $DB; $userid = self::getUserId(); $data = [$userid, $name]; $row = $DB->get_row("SELECT * FROM `auth_session` WHERE u= ? and k= ? limit 1", $data); if (is_array($row) && $row['e'] > time()) { return $row['v']; } return ''; } /** * 获取设备唯一标识 * @param boolean $update 是否刷新 */ public static function getUserId($update = false) { $userid = isset($_COOKIE['uid']) ? $_COOKIE['uid'] : null; if ($update || empty($userid) || !isset($_COOKIE['uid'])) { $userid = md5(uniqid(mt_rand(), 1) . time() . rand(1111, 9999) . x_real_ip()); setcookie('uid', $userid, time() + 86400 * 30, '/', null); } return $userid; } /** * 生成随机MD5字符串 * @return string */ public static function getRandString() { return md5(uniqid(mt_rand(), 1) . time() . rand(11111, 99999) . x_real_ip()); } /** * 清空当前设备cookie * @param [type] $name [description] * @return [type] [description] */ public static function checkDel($name) { $num = 0; if (is_array($_COOKIE)) { foreach ($_COOKIE as $key => $value) { if ($key == $name) { $num++; } } if ($num >= 2) { unset($_COOKIE[$name]); } } }}
沉梦Free惠易付系统是沉梦科技旗下推出的一款免费惠易付系统沉梦科技承诺:可能会推出付费版本,但免费版永久可用!!下面贴出更新日志(下载链接在最下面)2023年7月大更新,推出无授权永久版本!仅需80元永久使用无后门超级流畅