分类 大前端 下的文章

{
  // Same API as `v-bind:class`, accepting either
  // a string, object, or array of strings and objects.
  class: {
    foo: true,
    bar: false
  },
  // Same API as `v-bind:style`, accepting either
  // a string, object, or array of objects.
  style: {
    color: 'red',
    fontSize: '14px'
  },
  // Normal HTML attributes
  attrs: {
    id: 'foo'
  },
  // Component props
  props: {
    myProp: 'bar'
  },
  // DOM properties
  domProps: {
    innerHTML: 'baz'
  },
  // Event handlers are nested under `on`, though
  // modifiers such as in `v-on:keyup.enter` are not
  // supported. You'll have to manually check the
  // keyCode in the handler instead.
  on: {
    click: this.clickHandler
  },
  // For components only. Allows you to listen to
  // native events, rather than events emitted from
  // the component using `vm.$emit`.
  nativeOn: {
    click: this.nativeClickHandler
  },
  // Custom directives. Note that the `binding`'s
  // `oldValue` cannot be set, as Vue keeps track
  // of it for you.
  directives: [
    {
      name: 'my-custom-directive',
      value: '2',
      expression: '1 + 1',
      arg: 'foo',
      modifiers: {
        bar: true
      }
    }
  ],
  // Scoped slots in the form of
  // { name: props => VNode | Array<VNode> }
  scopedSlots: {
    default: props => createElement('span', props.text)
  },
  // The name of the slot, if this component is the
  // child of another component
  slot: 'name-of-slot',
  // Other special top-level properties
  key: 'myKey',
  ref: 'myRef',
  // If you are applying the same ref name to multiple
  // elements in the render function. This will make `$refs.myRef` become an
  // array
  refInFor: true
}

更新 2023年3月23日

测试了 v16.13.2 也是可以的
最新版的 LTS v18.15.0 是支持的

作废

The Array.at(index) method was introduced with ECMAScript 2019 (ES10). Therefore, the minimum version of Node.js that supports this method is Node.js v12.4.0. Any version of Node.js that is equal to, or greater than, v12.4.0 will include support for the Array.at() method.

There are several npm packages available for obfuscating Node.js and Express source code. Here are some popular ones:

  1. JavaScript obfuscator - This npm package can obfuscate JavaScript code including Node.js and Express source code. You can customize the settings to change the degree of obfuscation.
  2. UglifyJS - This package can minify and obfuscate JavaScript code, including Node.js and Express source code. It also supports source maps, which makes it easier to debug your code.
  3. Obfuscator - This is another popular npm package for obfuscating JavaScript code, including Node.js and Express source code. It offers options to customize the obfuscation process.
  4. Jscrambler - This is a commercial tool that can obfuscate and protect your Node.js and Express source code. It offers a wide range of features, including code obfuscation, control flow flattening, function and variable renaming, code locks, white-box cryptography, and much more.

It's worth noting that while obfuscation can make it harder for someone to understand your code, it's not a foolproof way to protect your intellectual property. If you want to ensure the full security of your Node.js and Express source code, you may want to consider other security measures such as encryption, access control, and monitoring/logging.

更新:2023年3月17日

要在 Chrome 浏览器中打开 "Show user agent shadow DOM" 选项,请按照以下步骤操作:

  1. 打开 Chrome 浏览器。
  2. 右键单击浏览器中的任何页面,并选择 "检查" 或按下快捷键 "Ctrl+Shift+I" 打开开发者工具。
  3. 单击开发者工具右上角的选项(三个竖点)。
  4. 选择 "Settings"。
  5. 在 "Settings" 窗口中,单击 "General" 标签。
  6. 在 "Elements" 部分,勾选 "Show user agent shadow DOM" 选项。
    现在你就可以在开发者工具中看到 Shadow DOM 的内容。

## 作废

在 Chrome 浏览器中打开“Show user agent shadow DOM”选项,请按照以下步骤操作:

  1. 打开 Chrome 浏览器并输入 chrome://flags/,并按下 Enter 键。
  2. 在页面上搜索 "Shadow DOM"。
  3. 找到 "Show user agent shadow DOM" 选项并将其设置为 "Enabled"。
  4. 点击页面底部的 "Relaunch" 按钮,以使更改生效。

完成上述步骤后,您应该能够在 Chrome 浏览器的开发者工具中查看用户代理的 Shadow DOM。

VM、REM、PX和EM都是web开发中用于定义字体大小、长度和距离的度量单位。

  • PX 是一个固定的度量单位,相对于页面上的其他元素不会改变。
  • EM 是基于其父元素的字体大小的相对单位。
  • REM也是一个相对的单位,但它是基于页面根元素(通常是html标签)的字体大小。
  • VM 是基于视口大小的相对单位,其中 1 个视口单位等于视区宽度的 1%。

总之,PX 是固定的,EM 和 REM 基于字体大小,而 VM 基于视口大小。