鍍金池/ 問答
孤巷 回答

根據(jù)《Effect Java》第二版總結:
異常分為:

  1. 受檢異常(checked exception,你說的編譯異常是指這個吧?)
  2. 運行時異常(runtime exception)
  3. 錯誤(error)

運行時異常和錯誤都是不需要也不應該被捕獲的可拋出結構。如果程序拋出運行時異常或者錯誤,說明出現(xiàn)了不可恢復的情形,繼續(xù)執(zhí)行下去有害無益。如果沒有捕捉到這樣的結構,將會導致當前線程停止,并出現(xiàn)適當?shù)腻e誤消息。

使用原則:

  1. 如果期望調用者能夠適當?shù)鼗謴?,對于這種情況就使用受檢的異常。
  2. 用運行時異常來表明編程錯誤。
  3. 如果不清楚是否有可能恢復,則使用未受檢異常。
久不遇 回答

首先給你點個贊,8.0發(fā)布后還真沒注意到有這個新特性,剛去mysql官網(wǎng)查了下,如下:

The .frm metadata files previously associated with base tables and views no longer exist. Metadata previously stored in .frm files is now stored in data dictionary tables.

Similarly, trigger metadata previously stored in .TRG and .TRN files is stored in a data dictionary table and those files no longer exist.

大概就是說.frm元數(shù)據(jù)文件已經(jīng)不存在了,現(xiàn)在被存儲在數(shù)據(jù)字典表中了。至于數(shù)據(jù)字典在哪,沒細看,應該是在information_schema庫中,對比下表改動還是很大的。
上面還給出一個信息.TRG觸發(fā)器文件也不存在了。
傳送門

神曲 回答

感覺像是node版本問題,前幾天我剛用yarn裝過@vue/cli
另外yarn我設置了阿里的鏡像源。
我的版本信息如下:
clipboard.png
希望能對你有所幫助。
vue create 創(chuàng)建項目時如果選擇了SASS 需要安裝python 2.x 版本。

clipboard.png

命于你 回答

參考ant-design的新增和關閉頁簽ant-design

苦妄 回答

bindscrolltoupper 這個能滿足嗎 也是 scroll-view 中的方法

風清揚 回答
注解本質上就是一個接口,它的實質定義為: interface SomeAnnotation extends Annotation。
這個 Annotation 接口位于 java/lang/annotation 包,它的注釋中第一句話就是 The common interface extended by all annotation types.
-- 通過反射,動態(tài)修改注解的某個屬性值
陌璃 回答

沒有驗證過,但是我個人理解是 用session 的話,如果登陸信息放緩存,那么重啟肯定沒了,如果放數(shù)據(jù)庫那還有。
用token的話,只要時間不過期,登陸狀態(tài)應該不會消失。

放開她 回答
class PrivateRoute extends React.Component {

    render(){
        const { component: Component, ...rest } = this.props
        
        return (
            <Route
                {...rest}
                render={props =>
                  fakeAuth.isAuthenticated ? (
                    <Component {...props} />
                  ) : (
                    <Redirect
                      to={{
                        pathname: "/login",
                        state: { from: props.location }
                      }}
                    />
                  )
                }
              />)
    }
  
}
葬憶 回答

播放不了
如果你是想播放騰訊視頻的話,直接跳轉到視頻鏈接就行了

悶油瓶 回答

<transition name="fade" mode="out-in">
<router-view :key="當前時間戳即可">
</router-view>
</transition>

悶油瓶 回答

.eslintrc.js 的 rules 加上

"vue/no-parsing-error": [2, { "x-invalid-end-tag": false }]

其他解釋可見 iview--issue

凹凸曼 回答

提取 js 中的 css 部分到單獨的文件

這種情況下所以單獨需要配置 publicPath,復寫其中資源的路徑
夕顏 回答

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.
以上是官方文檔對批量setState的解釋,只說了說setState會排隊,但實際上,在當前版本中,在不同的地方批量執(zhí)行setState會有不同的表現(xiàn)。

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

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 和之前),在默認情況下,只有直接在react生命周期React event handlers里寫的setState會被合并處理
未來版本(大概從React 17 開始),React會默認合并所有的setState

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

萌二代 回答

InputStream stream = ClassLoader.getSystemResourceAsStream("xx.txt");

        if (stream == null) {
            URL url = ClassLoader.getSystemResource("BOOT-INF");
            if (url != null) {
                String path = url.getFile();
                path = path.substring(5, path.lastIndexOf("!"));
                JarFile jarFile = new JarFile(path);
                JarEntry entry = jarFile.getJarEntry("BOOT-INF/lib/xx.jar");
                InputStream is = jarFile.getInputStream(entry);
                String folder = System.getProperty("java.io.tmpdir");
                File file = new File(folder, "xx.jar");
                OutputStream output = new FileOutputStream(file);
                int bytesRead = 0;
                byte[] buffer = new byte[8192];
                while ((bytesRead = is.read(buffer, 0, 8192)) != -1) {
                    output.write(buffer, 0, bytesRead);
                }
                output.close();
                is.close();
                JarFile jar = new JarFile(file);
                JarEntry jarEntry = jar.getJarEntry("xx.txt");
                stream = jar.getInputStream(jarEntry);
            }
        }
孤巷 回答

500是服務器內部錯誤了,通過程序打印肯定是看不到錯誤信息了。建議查看Nginx,PHP的錯誤日志文件。

陪妳哭 回答

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

安若晴 回答

先將id打印出來看一看,然后代碼改進

// this.userList.forEach...
this.userInfo = this.userList.find(item => item.id === id)