小编rob*_*tot的帖子

Neovim 错误:E492:不是编辑器命令:PlugInstall

操作系统:Ubuntu 18.04.3 LTS

我刚刚使用安装了 neovimsudo apt-get install neovim并添加了文件夹和文件~/.config/nvim/vim.init。此时该文件没有内容,但是当我打开nvim并键入时:PlugInstall出现错误:E492: Not an editor command: PlugInstall。我一头雾水,到底出了什么问题?

neovim

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

从 dxi-column [calculateCellValue] 函数调用的函数访问组件范围

最后一个问题是,我无法从使用 [calculateCellValue]="function" 调用的函数访问 component.ts 的上下文,如果我使用 .bind(this) 传递它,DataGrids 交互功能将不再工作。

最后一个问题:如何防止 .bind(this) 以避免 DataGrid 的功能变得不起作用,或者确保我不需要执行 [calculateCellValue]="function.bind(this)" 来传递 DataGrid 的上下文组件到函数,并以其他方式使用正常的 [calculateCellValue]="function" 方法传递上下文。

代码如下所示:

我将 DxDataGrid 与 DxiColumns 一起使用,它调用组件函数:

<dxi-column dataField="exampleField" [calculateCellValue]="getExamplevalues"></dxi-column>
Run Code Online (Sandbox Code Playgroud)

Angular 组件中的 getExamplevalues 函数如下所示:

getExampleValues(dataGridContext: any) {
    return this.exampleItems.length;
}
Run Code Online (Sandbox Code Playgroud)

exampleItems 在组件的 ngOnInit 函数中启动:

  public example$: Subscription;
  public exampleItems: any;

  constructor(private exampleService: ExampleService) { }

  ngOnInit(): void {
    this.example$ = this.exampleService.getAll().subscribe(items => this.exampleItems = items);
  }
Run Code Online (Sandbox Code Playgroud)

但是,在 getExamplevalues 函数中, this.exampleItems 始终未定义,因为该函数仅返回 DxDataGrid 的上下文,而不返回 Angular component.ts 上下文。

解决方案是改变:

<dxi-column dataField="exampleField" [calculateCellValue]="getExampleValues"></dxi-column>
Run Code Online (Sandbox Code Playgroud)

=>

<dxi-column …
Run Code Online (Sandbox Code Playgroud)

devexpress devextreme dx-data-grid angular devextreme-angular

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

Vuetify:覆盖特定于组件的 SASS 变量时出错

我遵循有关如何覆盖 Vuetify SASS 变量的官方指南(链接),其中显示:

\n
\n

在 src/styles 目录中创建 main.scss 文件并更新 vuetify.js 文件中的\n样式导入:

\n
\n

src/样式/main.scss

\n
@use \'vuetify\' with (\n  $app-bar-background: \'red\';\n);\n
Run Code Online (Sandbox Code Playgroud)\n

src/plugins/vuetify.ts

\n
import \'@/styles/main.scss\'\n
Run Code Online (Sandbox Code Playgroud)\n

但是,我在应用程序启动时收到此错误消息:

\n
[sass] This variable was not declared with !default in the @used module.\n  \xe2\x95\xb7\n2 \xe2\x94\x82     $app-bar-background: \'red\'\n  \xe2\x94\x82     ^^^^^^^^^^^^^^^^^^^^^^^^^^\n  \xe2\x95\xb5\n  src/styles/main.scss 2:5  root stylesheet\n10:58:31 AM [vite] Internal server error: [sass] This variable was not declared with !default in the @used module.\n  \xe2\x95\xb7\n2 \xe2\x94\x82     $app-bar-background: \'red\'\n  \xe2\x94\x82     ^^^^^^^^^^^^^^^^^^^^^^^^^^\n  \xe2\x95\xb5\n …
Run Code Online (Sandbox Code Playgroud)

vuetify.js vuetifyjs3

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

Feathersjs - 多个身份验证端点

我有来自两个不同客户端(Angular 客户端和 Node.js Feathes 客户端)的传入连接,我希望它们使用两个不同的身份验证端点(基于两个单独表中的数据)。一个应该针对 /users 服务进行身份验证,另一些则针对 /user2 服务进行身份验证。

如何才能实现这一目标?

这是它与一个身份验证端点一起工作的方式:

// default.json
"authentication": {
    "secret": "<secret>",
    "strategies": [
      "jwt",
      "local"
    ],
    "path": "/authentication",
    "service": "users",
    "jwt": {
      "header": {
        "typ": "access"
      },
      "audience": "https://yourdomain.com",
      "subject": "anonymous",
      "issuer": "feathers",
      "algorithm": "HS256",
      "expiresIn": "1d"
    },
    "local": {
      "entity": "user",
      "usernameField": "email",
      "passwordField": "password"
    }
  }

// authentication.js
const authentication = require('@feathersjs/authentication');
const jwt = require('@feathersjs/authentication-jwt');
const local = require('@feathersjs/authentication-local');

module.exports = function (app) {
  const config = app.get('authentication');

  app.configure(authentication(config));
  app.configure(jwt());
  app.configure(local()); …
Run Code Online (Sandbox Code Playgroud)

feathersjs feathers-authentication

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