小编Mah*_*ari的帖子

自 M91 起,SharedArrayBuffer 将需要跨域隔离,大约在 2021 年 5 月

通过创建npx create-react-appReact应用程序并运行它时,DevTools(Chrome 88 和 89)中会弹出警告:

scheduler.development.js:298 [Deprecation] 自 M91 起,即 2021 年 5 月左右,SharedArrayBuffer 将需要跨源隔离。有关更多详细信息,请参阅 https://developer.chrome.com/blog/enabling-shared-array-buffer/

环境

  current version of create-react-app: 4.0.1
  running from /Users/mahdi/.npm/_npx/25767/lib/node_modules/create-react-app
  Binaries:
    Node: 14.15.4 - ~/.nvm/versions/node/v14.15.4/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.10 - ~/.nvm/versions/node/v14.15.4/bin/npm
  Browsers:
    Chrome: 88.0.4324.96
    Edge: 87.0.664.66
    Firefox: 84.0
    Safari: 14.0.2
  npmPackages:
    react: ^17.0.1 => 17.0.1
    react-dom: ^17.0.1 => 17.0.1
    react-scripts: Not Found
  npmGlobalPackages:
    create-react-app: Not Found
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

重现步骤

  1. npx create-react-app myapp
  2. cd myapp && npm start Open
  3. Chrome 88 或 89 …

google-chrome reactjs

98
推荐指数
4
解决办法
4万
查看次数

如何在特定项目中禁用“初始化 JS/TS 语言功能”?

我有一个 Laravel 项目在 Visual Studio Code 中开发它。此外,我在一个单独的项目中也使用了 Angular 8 的前端,该项目也使用了 VSC。我构建了 Angular 项目并将构建版本推送到 Laravel 项目中。

现在,当我处理我的 Laravel 项目时,页脚内一直VSC显示Initializing JS/TS Language Features消息,这严重影响了我的计算机的性能。

vsc中的错误图片

当我在其他项目中使用此功能时,有没有办法仅在特定项目中禁用此功能?在我的 Laravel 项目中。

laravel visual-studio-code

17
推荐指数
3
解决办法
1万
查看次数

`bind(this)是什么意思?

在应用程序中onInit控制器功能的某些部分,SAPUI5有一个自动生成的代码,如下所示:

    this.getView().addEventDelegate({
            onBeforeFirstShow: function() {
                // Some codes
            }.bind(this)
        });
Run Code Online (Sandbox Code Playgroud)

现在我的问题是什么.bind(this)意思?它有什么作用?它是纯JavaScript代码还是与SAPUI5相关?

javascript sapui5

9
推荐指数
2
解决办法
1万
查看次数

错误“冲突解决程序拒绝突变。” 当在放大中删除时

我有一个简单的全栈放大应用程序。

\n

这是我的模型:

\n
type Note @model @auth(rules: [{allow: public}]) {\n  id: ID!\n  name: String!\n  description: String\n  image: String\n  NoteType: NoteType @connection\n}\n\ntype NoteType @model @auth(rules: [{allow: public}]) {\n  id: ID!\n  name: String!\n}\n
Run Code Online (Sandbox Code Playgroud)\n

我正在尝试删除具有以下有效负载的注释:

\n
type Note @model @auth(rules: [{allow: public}]) {\n  id: ID!\n  name: String!\n  description: String\n  image: String\n  NoteType: NoteType @connection\n}\n\ntype NoteType @model @auth(rules: [{allow: public}]) {\n  id: ID!\n  name: String!\n}\n
Run Code Online (Sandbox Code Playgroud)\n

我在响应中看到的是以下 json:

\n
{\n    "query": "mutation DeleteNote($input: DeleteNoteInput!, $condition: ModelNoteConditionInput) {\xe2\x86\xb5  deleteNote(input: $input, condition: $condition) {\xe2\x86\xb5 …
Run Code Online (Sandbox Code Playgroud)

reactjs graphql aws-amplify

8
推荐指数
1
解决办法
5953
查看次数

如何解决Php 7没找到Sqlite3?

我将我的Ubuntu升级到16.04 LTS.我在那个操作系统上有php5.我在一个脚本中使用了Sqlite3,我可以轻松地从cli运行它.

升级后没有它是运行cli => /etc/php/7.0/cli的php7

但它无法检测SQLite3,我得到'PHP致命错误:类'SQLite3'找不到'错误.

我尝试使用此命令再次安装它:

sudo apt-get install sqlite3
Run Code Online (Sandbox Code Playgroud)

但它说它现在安装了.

我如何解决php7可以检测SQLite3的这个问题?

提前致谢

php sqlite ubuntu-16.04

7
推荐指数
2
解决办法
2万
查看次数

为什么SAPUI5会多次加载类似的片段?

我有一个XML片段,并在XML视图的多个地方使用它。

<IconTabFilter text="ABC" key="1" icon="sap-icon://alphabetical-order">
    <content>
        <Table id="table1" width="auto" items="{path:'/ContactSet',parameters:{expand:'BusinessAddress,HomeAddress,OtherAddress,Photo'},filters:[{path:'Surname',operator:'StartsWith',value1:'A'},{path:'Surname',operator:'StartsWith',value1:'B'},{path:'Surname',operator:'StartsWith',value1:'C'}]}" noDataText=" {worklistView>/tableNoDataText}" busyIndicatorDelay="{worklistView>/tableBusyDelay}" growing="true" growingScrollToLoad="true" updateFinished="onUpdateFinished">
            <headerToolbar>
                <core:Fragment fragmentName="de.cimt.cimply.AddressBook.view.worklist.tablesHeader" type="XML"/>
            </headerToolbar>
            <columns>
                <core:Fragment fragmentName="de.cimt.cimply.AddressBook.view.worklist.tablesColumns" type="XML"/>
            </columns>
            <items>
                <core:Fragment fragmentName="de.cimt.cimply.AddressBook.view.worklist.tablesRows" type="XML"/>
            </items>
        </Table>
    </content>
</IconTabFilter>
<IconTabSeparator icon="sap-icon://process"/>
<IconTabFilter text="DEF" key="2" icon="sap-icon://alphabetical-order">
    <content>
        <Table id="table2" width="auto" items="{path:'/ContactSet',parameters:{expand:'BusinessAddress,HomeAddress,OtherAddress,Photo'},filters:[{path:'Surname',operator:'StartsWith',value1:'D'},{path:'Surname',operator:'StartsWith',value1:'E'},{path:'Surname',operator:'StartsWith',value1:'F'}]}" noDataText="{worklistView>/tableNoDataText}" busyIndicatorDelay="{worklistView>/tableBusyDelay}" growing="true" growingScrollToLoad="true" updateFinished="onUpdateFinished">
            <headerToolbar>
                <core:Fragment fragmentName="de.cimt.cimply.AddressBook.view.worklist.tablesHeader" type="XML"/>
            </headerToolbar>
            <columns>
                <core:Fragment fragmentName="de.cimt.cimply.AddressBook.view.worklist.tablesColumns" type="XML"/>
            </columns>
            <items>
                <core:Fragment fragmentName="de.cimt.cimply.AddressBook.view.worklist.tablesRows" type="XML"/>
            </items>
        </Table>
    </content>
</IconTabFilter>
Run Code Online (Sandbox Code Playgroud)

但是视图加载时间太长,尤其是在WEBIDE中。

原因是它多次加载了类似的片段文件。这是一个证据:

显示SAPUI5如何加载xml文件

问题是如何改善性能?

我不想重复代码,我需要将代码的那一部分放在一个片段中,但是我希望我的浏览器不会多次加载相同的文件。

browser performance caching sapui5

5
推荐指数
1
解决办法
99
查看次数

Laravel 创建具有两个时间戳列的表时出错

我在 Laravel 6.6 中创建了一个具有以下定义的表。

public function up()
{
    Schema::create('quarters', function (Blueprint $table) {
        $table->integer('quarter_id')->unsigned();
        $table->integer('year')->unsigned();
        $table->integer('quarter_num')->unsigned();
        $table->timestamp('valid_from');
        $table->timestamp('valid_to'); // <------ error on this line
        $table->string('description')->nullable();
        $table->timestamps();
        $table->primary('quarter_id');
    });
} 
Run Code Online (Sandbox Code Playgroud)

当我运行迁移命令时,出现以下错误。

Illuminate\Database\QueryException : SQLSTATE[42000]:语法错误或访问冲突:1067 'valid_to' 的默认值无效(SQL:创建表quartersquarter_idint unsigned not null、year int unsigned not null、quarter_numint unsigned not null、valid_fromtimestamp not null、valid_to时间戳不为空、description varchar(255) 为空、created_at时间戳为空、updated_at时间戳为空) 默认字符集 utf8mb4 collat​​e 'utf8mb4_unicode_ci')

这是 Eloquent 生成的 SQL:

CREATE TABLE `quarters`(
    `quarter_id` INT UNSIGNED NOT …
Run Code Online (Sandbox Code Playgroud)

php mariadb eloquent laravel-6

4
推荐指数
1
解决办法
7297
查看次数

如何使用Apache POI在docx文件中设置运行的背景颜色(行中的单词或段落)?

我想使用Apache POI创建一个docx文件.

我想设置一个运行的背景颜色(即一个单词或段落的某些部分).

我怎样才能做到这一点?

是否有可能通过Apache POI.

提前致谢

apache-poi xwpf

3
推荐指数
1
解决办法
3254
查看次数

Chrome 在登录页面中建议密码

我有一个网络应用程序,当我在手机上的 Chrome 中打开它时,它建议在登录页面中生成密码,如下所示。

在此输入图像描述

问题是,我如何向我的 html 字段添加一些语义,chrome 只是建议在注册页面而不是登录页面中生成强密码。

html google-chrome

3
推荐指数
1
解决办法
700
查看次数

如何撤消已绑定到OData模型的表单中的用户更改?

我在SAPUI5中的主 - 详细信息应用程序中有一个表单.表单元素绑定到OData模型条目.我想在undo我的表单中添加一个按钮,如果用户更改了表单内部的数据并且他或她知道了更改,则在保存数据之前要撤消更改without refreshing页面,可以按下undo按钮并重新加载原始数据来自OData.

现在的问题是,是否有任何功能可以使用并刷新表单内的数据而无需连接到服务器或刷新页面?

我知道如何从Odata模型中读取数据并将其再次绑定到输入字段,我想知道是否还有更聪明的方法?

sapui5

2
推荐指数
1
解决办法
3375
查看次数