在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問(wèn)答
深記你 回答

es6 是如何實(shí)現(xiàn), 原型鏈, 原因就知道了

使用是自己定的, 每種強(qiáng)類型語(yǔ)言也都沒(méi)有限定死

慢半拍 回答

1,這其實(shí)是塊級(jí)作用域的問(wèn)題,并沒(méi)有涉及到閉包。
2,產(chǎn)生原因在于var與let使用的作用域不同。
var 變量的作用域是全局,而let 是局部的塊作用域即for循環(huán)內(nèi),
全局變量唯一性,var 聲明的變量i在循環(huán)中被不斷覆蓋最終只是唯一的10,因此在外部調(diào)用中無(wú)論li的哪一個(gè),最終都是10。
而let是局部的作用域,并不會(huì)被覆蓋。

執(zhí)念 回答

我的 webpack.prod.conf.js 配置

plugins: [
...
new ParallelUglifyPlugin({
  cacheDir: '.cache/',
  uglifyJS: {
    output: {
      comments: false
    },
    compress: {
      warnings: false
    }
  },
  sourceMap: config.build.productionSourceMap
}),
...
]

打包沒(méi)問(wèn)題

帥到炸 回答

getUserInfo拿到的只是基礎(chǔ)信息頭像昵稱什么的,使用code在服務(wù)端拿的是用戶的sessionkey、openId,這兩個(gè)信息顯然更隱私一些,代表著這個(gè)用戶。

互擼娃 回答

1.虛擬域名指向/var/wwwroot/abc/public
2.Nginx.conf 配置忽略index:

if (!-e $request_filename){
        rewrite  ^(.*)$  /index.php?s=$1  last;
        break;
     }

3..htaccess如果啟用了,可以試試這個(gè)配置

<IfModule mod_rewrite.c>
  Options +FollowSymlinks -Multiviews
  RewriteEngine On

  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfModule>

4.runtime是否有足夠權(quán)限

如果還不行,可以看看nginx的日志,或者php-fpm日志(打開(kāi) php.ini 搜索 display_errors,把 Off 修改為 On就開(kāi)啟了 php 錯(cuò)誤提示)

圖示是我的配置圖,可供參考:

clipboard.png

咕嚕嚕 回答

沒(méi)看到你的代碼,我大膽猜測(cè)問(wèn)題可能出現(xiàn)在步驟3. 測(cè)試Spring Boot應(yīng)用,他的這個(gè)demo中出于便利性考慮,main和Ctrl合并到一個(gè)類中了,我這里給出分離的寫法:

/**
 * 這是Spring Boot應(yīng)用的入口類
 */
@SpringBootApplication
public class DemoApplication{
    public static void main(String[] args){
        SpringApplication.run(DemoApplication.class, args);
    }

}

在該入口類的同級(jí)或以下創(chuàng)建一個(gè)DemoCtrl類,具體如下:

@Controller
@RequestMapping("/")
public class DemoCtrl{
    /**
     * web rounter
     */
     @RequestMapping("/hi")
     public String hello(ModelMap map){
         return "index";
     }
}

然后在resource下的template目錄下創(chuàng)建你的index.html文件,啟動(dòng)項(xiàng)目,應(yīng)該就可以看到hello spring boot了

更新一下,這里有個(gè)點(diǎn)需要注意一下,@RestController和@Controller面向Web的時(shí)候的區(qū)別。
如果你使用@RestController注解的話你應(yīng)該使用如下類似操作:

@RequestMapping("hi")
public ModelAndView hello(){
    return new ModelAndView("index");//改index.html 文件在template目錄下
}

如果使用的是@Controller注解的話,按照第一種方式便可以正確的映射到view了。

再次更新
如果是Spring MVC的話,在沒(méi)有配置默認(rèn)的view引擎的時(shí)候,需要把view文件寫全,如下:

/**
     * web rounter
     */
     @RequestMapping("/hi")
     public String hello(ModelMap map){
         return "index.jsp"; // 這里以jsp為例
     }
玄鳥(niǎo) 回答

個(gè)人思路:

  1. github上面刪除project1,project2項(xiàng)目
  2. 將新的project2推送到github上
久舊酒 回答

你是想讓你cover-view里的內(nèi)容輪播把,如果是那我覺(jué)得你的swiper寫錯(cuò)地方了,應(yīng)該放在cover-view里面吧

兮顏 回答

打包后的js、css如果是公用的(比如bundle.js、bundle.css之類),路由跳轉(zhuǎn)又是在一個(gè)域名下(你當(dāng)前項(xiàng)目路由內(nèi)的各路由),是不會(huì)重新加載公用文件的,除非你自己刷新了頁(yè)面。

病癮 回答

https://codepen.io/caocong/pe...
直接從snapchat copy了相關(guān)的css 然后精簡(jiǎn)了一下就是這樣的效果

初念 回答

透明度會(huì)被繼承,你過(guò)度要對(duì)元素添加

背叛者 回答

你現(xiàn)在的寫法基本上沒(méi)有用到redux,下面是我改造了一下。
在redux中獲取checkbox的狀態(tài):就是在點(diǎn)擊checkbox的時(shí)候,dispatch一個(gè)action,傳遞需要的參數(shù)(索引,是否選中),然后在對(duì)應(yīng)的reducer函數(shù)中修改狀態(tài)。修改狀態(tài)成功后頁(yè)面上就能拿到最新的狀態(tài),你提交、傳遞數(shù)據(jù)都可以用這個(gè)最新的狀態(tài)。
reducer部分

// state格式建議寫成這樣。權(quán)限使用一個(gè)數(shù)組,然后循環(huán)出來(lái)。
const initialState = {
  userinfo: {
    userName: '',
    permission: [{
      name: '開(kāi)發(fā)者權(quán)限',
      checked: true,
    }, {
      name: '體驗(yàn)者權(quán)限',
      checked: false,
    }, {
      name: '登錄',
      checked: false,
    }, {
      name: '數(shù)據(jù)分析',
      checked: false,
    }, {
      name: '開(kāi)發(fā)管理',
      checked: false,
    }],
  }
};
// 修改選中狀態(tài)
export default function userPermission(state = initialState, action) {
  switch (action.type) {
    case 'CHANGE_PERMISSION':
      const newData = state.userinfo.permission.map((item, index) =>
        action.index === index ? {
          ...item,
          checked: action.checked
        } : item
      );
      return {
        userinfo: {
          ...state.userinfo,
          permission: newData
        }
      };
    default:
      return state;
  }
}

頁(yè)面關(guān)鍵代碼

import React from 'react';
import { connect } from 'react-redux';

class AddUser extends React.Component {
  code...
   render() {
    const {
      userinfo,
      handleChange,
    } = this.props;

    return (
      <div className="add_page">
        code...
        {
          // 循環(huán)顯示權(quán)限,點(diǎn)擊時(shí)調(diào)用handleChange,把當(dāng)前選擇狀態(tài)和索引當(dāng)做參數(shù)傳遞出去
          userinfo.permission.map((item, index) => (
            <div key={index}>
              <span>{item.name}</span>
              <input type="checkbox" className="adduser_check" name={index} checked={item.checked} onChange={(e) => handleChange(e.target.checked, index)} />
            </div>
          ))
        }
        code...
      </div>
    )
  }
}

function mapStateToProps(state) {
  return {
    userinfo: state.userinfo,
  };
}

function mapDispatchToProps(dispatch) {
  // 這里偷了點(diǎn)懶,最好應(yīng)該是調(diào)用一個(gè)action創(chuàng)建函數(shù)。然后它就去reducer修改狀態(tài)了。
  return {
    handleChange: (checked, index) => dispatch({ type: 'CHANGE_PERMISSION', checked, index }),
  };
}

export default connect(mapStateToProps, mapDispatchToProps)(AddUser);

修改姓名也是同樣的邏輯。
還有,樣式一會(huì)用class一會(huì)用className是什么鬼,只能用className好嘛。

久舊酒 回答

第二種方法更直觀,可讀性更好,但是沒(méi)有很好的擴(kuò)展性,看你自己的業(yè)務(wù)需求,像ajax方法,目前存在的就那么幾種,不會(huì)有更多,所以第二種方法我覺(jué)得更好

心悲涼 回答

user_id(7) 和 id(3) 不是在同一列嗎?

懶洋洋 回答

找個(gè)空文件夾把項(xiàng)目clone下來(lái),刪除內(nèi)容,push?;蛘咝陆▊€(gè)分支保存現(xiàn)在的代碼,清空master,合并分支

悶油瓶 回答

<transition name="fade" mode="out-in">
<router-view :key="當(dāng)前時(shí)間戳即可">
</router-view>
</transition>

夕顏 回答

https://reactjs.org/docs/reac...
setState() enqueues changes to the component state and tells React that this component and its children need to be re-rendered with the updated state. This is the primary method you use to update the user interface in response to event handlers and server responses.
以上是官方文檔對(duì)批量setState的解釋,只說(shuō)了說(shuō)setState會(huì)排隊(duì),但實(shí)際上,在當(dāng)前版本中,在不同的地方批量執(zhí)行setState會(huì)有不同的表現(xiàn)。

以下是官方文檔中給的一個(gè)鏈接,說(shuō)明在什么時(shí)候setState會(huì)被批量處理
In depth: When and why are setState() calls batched?(深入了解:什么時(shí)候并且為什么setState()調(diào)用會(huì)被合并)

Currently (React 16 and earlier), only updates inside React event handlers are batched by default. There is an unstable API to force batching outside of event handlers for rare cases when you need it.

In future versions (probably React 17 and later), React will batch all updates by default so you won't have to think about this. As always, we will announce any changes about this on the React blog and in the release notes.
現(xiàn)在(React 16 和之前),在默認(rèn)情況下,只有直接在react生命周期React event handlers里寫的setState會(huì)被合并處理
未來(lái)版本(大概從React 17 開(kāi)始),React會(huì)默認(rèn)合并所有的setState

下面官方文檔中給的另一個(gè)鏈接
In depth: Why isn’t this.state updated immediately?(深入了解:為什么this.state沒(méi)有被立刻更新?)

墨染殤 回答

replace接受函數(shù)作為參數(shù),如果匹配正則那么函數(shù)的第一個(gè)參數(shù)對(duì)應(yīng)$1,第二個(gè)對(duì)應(yīng)$2,以此類推...replace 使用function作為參數(shù)

let str = "123453333336789"
str.replace(/(.{3}).*(.{3})/, function(match,p1,p2){return p1+"*".repeat(str.length-6)+p2})
//"123*********789"
陪妳哭 回答

思路:寫一個(gè)function,把SYQX字段轉(zhuǎn)換為天數(shù)(整數(shù)),查詢的時(shí)候where里用按天數(shù)去比較,比如這個(gè)函數(shù)為syqx2Day,那么按3年以上的查詢就變成了條件 where syqx2Day(SYQX) > 1095