小编Ski*_*kif的帖子

如何在VSCode中隐藏缩进参考线?

我如何隐藏这些行:
在此处输入图片说明

获得更干净的代码视图。在官方文档中是这样的: 在此处输入图片说明

我该怎么做或在文档中找到设置?

visual-studio-code vscode-settings

13
推荐指数
4
解决办法
4339
查看次数

如何设置VSCode将花括号放在同一行上?

默认情况下

{path: '/post/:postId', component: Post},
Run Code Online (Sandbox Code Playgroud)

正在转换为此

{
    path: '/post/:postId',
    component: Post
},
Run Code Online (Sandbox Code Playgroud)

如何禁用此行为?

UPD。我用JavaScript编码,上次使用vetur插件在vuejs中编码

UPD2。代码示例。

// before
export default new Router({
  routes: [
    { path: '/', component: Home },
    { path: '/about', component: About },
    { path: '/todo', component: Todo },
  ]
})
// after formatting (curly braces are moved on new line)
export default new Router({
    routes: [{
            path: '/',
            component: Home
        },
        {
            path: '/about',
            component: About
        },
        {
            path: '/todo',
            component: Todo
        },
    ]
})
Run Code Online (Sandbox Code Playgroud)

UPD 3.也许Prettier对于解决此任务会有用吗? …

visual-studio-code vscode-settings

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

保证金之间有什么区别:auto和justify-content/align-items center?

要同时水平和垂直居中,有两个简单的选项:

第一

.outer {
  display:flex;
}
.inner {
  margin:auto;
}
Run Code Online (Sandbox Code Playgroud)

第二

.outer {
  display: flex;
  justify-content: center;
  align-items: center;
}
Run Code Online (Sandbox Code Playgroud)

有什么不同?在什么情况下我们会使用一个而不是另一个?

html css css3 centering flexbox

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

使用 TypeScript 的 Vue i18n 中出现错误:“类型‘VueConstructor’上不存在属性‘$t’。”。我该如何修复它?

在项目中,一些常用函数位于单独的 .ts 文件中。在这种情况下我该如何使用 i18:

// for i18n
import  Vue  from 'vue'
declare module 'vue/types/vue' {
  interface VueConstructor  {
    $t: any
  }
}
declare module 'vue/types/options' {
  interface ComponentOptions<V extends Vue> {
    t?: any
  }
}

(()=>{
  const test = Vue.$t('auth.title');
  console.log( test )
})()
Run Code Online (Sandbox Code Playgroud)

返回错误:

Property '$t' does not exist on type 'VueConstructor<Vue>"
Run Code Online (Sandbox Code Playgroud)

我该如何修复它?

javascript typescript vue.js vue-i18n

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

在 npm start 上创建 React 应用程序错误 - “找不到模块”

我正在尝试使用 create-react-app 启动 React 项目。npm start
出现错误:

Failed to compile.

multi ./node_modules/react-scripts/config/polyfills.js ./node_modules/react-dev-utils/webpackHotDevClient.js ./src/index.js
Module not found: Can't resolve 'D:\' in 'D:\!!!DESKTOP\React-test\test-react'
Run Code Online (Sandbox Code Playgroud)

我该如何修复它?

javascript npm reactjs create-react-app

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