ionote / .github

0 stars 0 forks source link

2023-10 #1

Open banli17 opened 10 months ago

banli17 commented 10 months ago

LaTeX 排版系统 https://www.latex-project.org/

httpCode : 408 请求超时,Request Timeout响应状态代码意味着服务器想要关闭此未使用的连接。即使客户端之前没有发出任何请求,某些服务器也会在空闲连接上发送它。

banli17 commented 10 months ago

eslintrc.js module is not defined

使用注释
/* eslint-env node */
或者
module.exports = {
  env: {
    node: true
  }
}

eslint 不生效问题

/* eslint-env node */
module.exports = {
  root: true,
  parser: 'vue-eslint-parser',
  globals: {
    THING: true,
    KissUI: true,
    Vue: true,
    app: true,
  },
  extends: ['plugin:vue/recommended', 'plugin:prettier/recommended'],
  plugins: ['vue', 'prettier'],
  rules: {
    'no-console': [1, { allow: ['warn', 'error', 'info'] }],
    'no-undef': [2],
  },
  parserOptions: {
    parser: '@babel/eslint-parser',  // 放 parserOptions 里
    requireConfigFile: false,
  },
}
banli17 commented 10 months ago

https://github.com/tiaanduplessis/kill-port/blob/master/index.js

banli17 commented 10 months ago

GET 请求无法在 body 里携带数据???

xhr规范:[https://xhr.spec.whatwg.org/#the-send( )-method](https://xhr.spec.whatwg.org/#the-send()-method)

send(body) 方法必须运行以下步骤: 如果未打开状态,则抛出“InvalidStateError”DOMException。 如果设置了 send() 标志,则抛出“InvalidStateError”DOMException。 如果请求方法为GET或HEAD,则将body设置为null。

https://github.com/axios/axios/issues/787

banli17 commented 10 months ago

reactive 和 ref 区别

reactiveref 是Vue 3中用于创建响应式数据的两个不同的函数。

ref 函数用于创建一个包装对象,将传入的值包装成一个响应式的数据。这个包装对象具有一个 .value 属性,用于访问和修改包装的值。当修改 .value 时,Vue会自动追踪依赖并进行相应的更新。

示例使用 ref 创建响应式数据:

import { ref } from 'vue';

const count = ref(0);

console.log(count.value); // 访问值
count.value++; // 修改值

reactive 函数用于创建一个响应式的普通对象。这个对象的所有属性都会被自动追踪,并在发生变化时进行更新。与 ref 不同,你可以直接访问和修改这个对象的属性,而不需要使用 .value

示例使用 reactive 创建响应式对象:

import { reactive } from 'vue';

const state = reactive({
  count: 0,
  message: 'Hello World'
});

console.log(state.count); // 访问属性
state.count++; // 修改属性

总结来说, ref 适用于创建单个值的响应式数据,而 reactive 适用于创建包含多个属性的响应式对象。