axios应用
应用例子
const instance=axios.create({
baseURL:'https://api.shop.eduwork.cn/',
headers: {'Authorization': 'Bearer Token'}
});
// console.log(instance);
instance({
url:……
webpack 原理与应用
打开命令行初始化项目
npm init
安装webpack-cli、webpack
npm install webpack-cli --save-dev //--save-dev表示开发时候依赖的东西
npm install webpack --save //--save是开发之后还依赖的东西
执行命令行,打包js
npx webpack index.js
//提示没执行那种模式 要加(--mo……
es6
var 与let
var没有块级作用域,let用它所声明的变量,只在let命令所在的代码块内有效
匿名函数的自调用函数体也要小括号包括:
(function(){
console.log('this function2')
})()
for(let i=0; i<10; i++) //for($i=0; $i<10; i++) for循环()里的数……
__FILE__用法
FILE 返回当前 路径+文件名
dirname(FILE) 返回当前文件路径的 路径部分
dirname(dirname(FILE));得到的是文件上一层目录名(不含最后一个“/”号)
woocommerce产品显示
woocommerce产品显示
产品设置展示的页面
Shop page 设置的页面没有Template这个选项设置
php的switch-case语句中为0的问题
$ii=0;
switch($ii){
case $ii > 300:
echo 'aa';
// break;
// var_dump($ii>=300);
//var_dump((int)300);
case 33:
echo 'bb';
// break;
case 0:……
水平居中
最近了解flex布局,关于居中对齐的,根据之前的居中对齐有:margin: 0 auto
现在介绍另一种方法:
这个更简单的方法来水平对齐绝对定位的元素:
position: absolute;
left: 50%;
transform: translateX(-50%);
利用calc左右间隔40
.banner {
position: absolute;
left: 40px;
width: calc(100% - 80px);
border: solid black 1px;
box-shadow: 1px 2px;
background-color: yellow;
padding: 6px;
text-align: center;
box-sizing: border-box;
}
change the number of columns in the product list for woocommerce
This can be done a number different of ways:
Add this to the functions.php file (不限于模板)
// Change number or products per row to 3
add_filter('loop_shop_columns', 'loop_columns');
if (!function_exists('loop_columns')) {
function loop_columns() {
……