Giter VIP home page Giter VIP logo

docs-cn's People

Contributors

antfu avatar arnaudbarre avatar benmccann avatar bluwy avatar brillout avatar btea avatar chenfan0 avatar docschina-bot avatar fi3ework avatar godliangcy avatar gumball12 avatar ivocin avatar jay-es avatar jizai1125 avatar kiaking avatar knowscount avatar miracles1919 avatar patak-dev avatar poyoho avatar qc-l avatar sapphi-red avatar shenqingchuan avatar shinigami92 avatar sodatea avatar waynzh avatar y1d7ng avatar ydcjeff avatar ygj6 avatar yyx990803 avatar zhangpaopao0609 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docs-cn's Issues

vite打包之后css文件中引用的静态资源路径不对

  1. 当我将静态资源(图片,字体)放在src的assets文件下,打包之后,所有css, js以及其他静态文件都会在dist的assets文件下。但是css中引用静态资源的路径却是"./assets/xxxx",应当为“./xxxx”

  2. 当我将静态资源(图片,字体)放在public文件下时,打包之后,css文件在dist的assets文件下,其他静态文件直接存在dist文件下。但是css中引用静态资源的路径却是"./xxxx",应当为“../xxxx”

lowdb with error when import lowdb new version

failed to load config from /Users/cheng.tao/Documents/sub-tc/tc/packages/tcvite/vite.config.ts
error when starting dev server:
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users/cheng.tao/Documents/sub-tc/tc/packages/tcvite/node_modules/lowdb/lib/index.js
require() of ES modules is not supported.

绝对路径怎么配置?

//测试文件的路径: test/components/HelloWorld.spec.ts
import HelloWorld from '../../src/components/HelloWorld.vue'

image

vite使用可选链操作手机端浏览器项目报错

当我使用vite创建vue3项目时,使用了可选链操作,代码如下
image
image
PC端浏览器是正常运行的
40ed5ac5dd0d45cec89d31935e856a6
当我使用vite创建react时,使用可选链操作也会报错
我使用vue ui创建vue3项目时,就不会出现问题
这是我的依赖 vue3
image
这是我测试的react项目依赖
image

vite ssr

有关vite ssr 中。比如我需要借助 三方的ui 插件来实现一些需求功能。
element-plus 中的 Cascader 级联选择器 不可以使用和其它小部分组件

naiveui 在ssr中的使用 任然遇到我们开发者无法解决的问题。
ssr 中在每个框架也好库的引入方式也好,都有自己的标准!!!

CDN方式引入资源可用,但在vscode显示红色波浪线

"vite": "^2.1.5",我在index.html中引入资源:
`<script src="https://cdn.jsdelivr.net/npm/[email protected]/moment.min.js"></script>

<script src="https://cdn.bootcdn.net/ajax/libs/lodash.js/4.17.21/lodash.min.js"></script>`

moment和lodash全局可用,但是显示红色波浪线,很不爽,显然是vscode找不到引用,请问如何处理?
Image

Linking from main docs and keeping URLs consistent across translations

Thanks a lot for all the work to maintain this translation ❤️

There was a request to add a link from the main page to these docs

I discussed with @kiaking that is involved in the Japanase translation effort https://github.com/vuejs-jp/vite-docs-ja, and he told me that URLs are kept in English in their version. This is a good idea to enable us to link to translations directly from a given page, and not defaulting to the home page.

For the moment, I think we should add a link to the top of the docs that will go to the homepage

image

When you think that the translation is ready, it would be great to link both of them. Let me know if you would like me to create a PR to do that.

build 问题

"scripts": {
"dev": "vite",
"build": "vite build",
"serve": "vite preview"
},
"dependencies": {
"vue": "^3.0.5",
"vue-router": "^4.0.10"
},
"devDependencies": {
"@vitejs/plugin-vue": "^1.2.4",
"@vue/compiler-sfc": "^3.0.5",
"vite": "^2.4.0"
}
dev 模式下 能显示路由里面的内容
build 以后 内容为空白了

require is not defined

npm run vite-dev error 'require is not defined'
const modulesFiles = require.context('./modules', true, /.js$/)

中文部分显示乱码

Info

  • Safari Version 14.0
  • macOS Mojave
  • 英文环境

在本地 yarn dev 的时候出现了这样的问题:

我笔记本本地是英文环境,可能是这个原因?

关于 vite 利用 cache 实现重载提速的翻译不够准确

Vite 同时利用 HTTP 头来加速整个页面的加载(再次让浏览器为我们做更多事情):源代码模块的请求会根据是否更改,利用 304 Not Modified 协商缓存,而依赖模块请求则会通过 Cache-Control: max-age=31536000,immutable 协商缓存,因此一旦被缓存它们将不会再次请求。

vite 在react-ts 中热更新速度慢

本人在使用vite 搭建的react-ts 的项目中,项目启动非常块,但是每当我启动好后,我在.tsx 文件中修改一些代码,浏览器并没有更新。刷新浏览器页面页没有生效。只有我重新 npm run dev 才会生效。目前我一直在寻找解决办法,苦于自己的英文是个二把刀。我的配置文件是这样的:
`import reactRefresh from '@vitejs/plugin-react-refresh'
import { defineConfig } from 'vite'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [reactRefresh()]
})
package.json 一开始的vite 是2.0.0的bata,目前是这样的:"devDependencies": {
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"@vitejs/plugin-react-refresh": "^1.3.1",
"typescript": "^4.1.2",
"vite": "^2.0.1"
}
}`

希望看到的能留意一下我的问题,并且目前的解决方案是啥? 感谢看到这个问题的。

Cannot read property 'exports' of undefined

var Re = void 0 !== ve.ResizeObserver ? ve.ResizeObserver : Ae
  , je = function(e) {
    b(r, n.exports.Component);
    var t = P(r);
    function r() {
        var e;
        return h(this, r),
        (e = t.apply(this, arguments)).resizeObserver = null,
        e.childNode = null,
        e.currentElement = null,
        e.state = {
            width: 0,
            height: 0,
            offsetHeight: 0,
            offsetWidth: 0
        },

拆分包以后报错Uncaught TypeError: Cannot read property 'exports' of undefined

Review 任务

本次认领仅限之前参加过 vite 文档翻译的小伙伴,具体原因请参考 #77

由于文档内容有限,建议一人一篇。

在 review 过程中,请务必认真对待,逐行逐字对比。因为最近同步过程中,发现了很多错漏内容。

格式规范请务必遵循 wiki,减少不必要的返工。

review 后内容,请提交到 dev 分支。

任务认领说明

从 Todo List 中选取未被人领取过的文章:

未被领取过:

  • guide/index

领取过:

领取过,已完成:

领取方式,在本 issues 下评论即可。

认领任务格式:

Section | Title | 译者 | 完成时间
-- | -- | -- | --
guide/index | 开始 | @QC-L | 2021.04.13 - 2021.04.13

示例效果:

Section Title 译者 完成时间
guide/index 开始 @QC-L 2021.04.13 - 2021.04.13

任务认领列表

Todo List:

「动态导入 polyfill」翻译可能存在歧义

guide/build.md 第 9 行中写道:

一个轻量级的 动态导入 polyfill 也会同时自动注入。

我自己看这个翻译的时候就误会了,因为「动态导入 polyfill」听起来就像是「项目中所需要的 polyfill 会被自动导入到项目中」,让我以为 Vite 会像 webpack 一样自动把所需要的 polyfill 导入到项目里。实际上,这里的「动态导入」指的是 ES6 里的一个特性。下文中也说了 polyfill 是不会自动导入的,所以我读文档的时候就纠结了很久。如果改成「对 import() 函数的 polyfill」或者「对动态导入这一特性的 polyfill」会不会更好?

怎样在css和js**享变量?

怎样在css和js**享变量吗,webpack用:export{
menuText: $menuText;}这种形式导入的正常,vite导进来的变量成这样的":export {
}",正确的应该是数组

vite会对node_modules内的库进行检验

这是报错信息
[@vue/compiler-sfc] ::v-deep usage as a combinator has been deprecated. Use :deep() instead.
按理说,这里面的项不应该做较验的,因为即使校验,我们也没有修改的权限,所以这类提示不应该出现,主要是看着蛋疼

PRs are not effective enough | 目前 PR 不够高效

I have been participating in this the development of this repo recently, and there is one small thing that I observed: most of the pull requests opened only make fixes upon one single sentence or character. Whereas, alas, merging those pull requests would add two commits to the repo, which will, eventually, lead to a huge amount of commits. Therefore, I, for one, reckon it a better idea to open the discussion function or simply to open a issue for people to suggest fixes and changes. This way, one single commit from you could resolve many an issue. Moreover, @ShenQingchuan, formatting issues that took place in my pull request would be diminished #14 accordingly.


最近,我一直在参与这个 repo 的开发,并注意到了一件小事:大多数 PR 只对一个句子或一个字符进行修复。而合并这些拉取请求,则会给这个 repo 带来两次 commit,最终给这个 repo 带来一大堆 @commits。因此,我认为最好的办法是开放讨论功能,或者干脆开放一个问题,让大家提出修正和修改。这样一来,你那边一次 commit 就可以解决很多问题。另外,我之前那 PR (#14)中发生的格式化问题也会相应减少。


BTW 我用中文还是英文?

绝对路径怎么配置?

//测试文件的路径: test/components/HelloWorld.spec.ts
import HelloWorld from '../../src/components/HelloWorld.vue'

Uploading image.png…

# 启动开发服务器 $ docs:dev 出现错误(旧环境下安装

以前一直用的vue2环境和webpack,这次按照步骤install并启动开发服务器,出现以下问题
1.命令行启动错误(文件名、目录名或卷标语法不正确。),已全局安装vitepress解决该问题。
2.成功打开vite服务后,页面空白,console报错。
image

devDependencies增加vue:3.0.5后, 报错变更

image

qustion

Uncaught SyntaxError: The requested module '/node_modules/.vite/vue.js?v=4244fef3' does not provide an export named 'default'

【寻人】翻译文档认领 —— 请在本仓库曾经贡献过代码的同学认领文档

本项目由 @ShenQingchuan 同学牵头从 2021 年 2 月 5 日开始对官方文档 进行翻译工作,感谢 @ShenQingchuan 做出的巨大贡献,期间有 23 位同学先后对本仓库进行了贡献。
感谢 @QC-L 和 印记中文 @docschina-bot 帮忙将本项目同步模式从人工同步模式迁移到了自动化模式,详见 #51
2021-04-01 - 2021-04-05 完成了这项工作,非常感谢。

这次 PR 后,原有的 main 主干重命名为 history,由于 GitHub Repo 展示的 Contributors 是主干的 Contributors,导致过去在本仓库贡献过代码的同学从 Contributor 中消失了,目前的 Contributors 是这样的:

截屏2021-04-13 上午3 57 43

iShot2021-04-13 04 37 30

这样名字从 Contributors 中消失可能会给很多曾经贡献的同学造成心理伤害,故希望基于 sync-docs 分支拉一个新分支,各位曾经的 Contributors 认领部分文档,进行 PR,尽量保证名字回归到 Contributors 中。

附: Contributors (按照时间排序),如有遗留,请补充

怎样在css和js**享变量?

怎样在css和js**享变量吗,webpack用:export{
menuText: $menuText;}这种形式导入的正常,vite导进来的变量成这样的":export {
}",正确的应该是数组

运行时出现Uncaught (in promise) ReferenceError: buildModifiers is not defined

Uncaught (in promise) ReferenceError: buildModifiers is not defined
at index.esm.js:1
at ComputedRefImpl.reactiveEffect [as effect] (reactivity.esm-bundler.js:42)
at ComputedRefImpl.get value [as value] (reactivity.esm-bundler.js:864)
at getter (runtime-core.esm-bundler.js:1958)
at reactiveEffect (reactivity.esm-bundler.js:42)
at doWatch (runtime-core.esm-bundler.js:2083)
at watch (runtime-core.esm-bundler.js:1937)
at Dl (index.esm.js:1)
at setup (index.esm.js:1)
at callWithErrorHandling (runtime-core.esm-bundler.js:154)

Should we specify a term translation convention?

In the process of translation or proofreading, I found that there are many translated versions of a word,for instance,
"bundle": "打包,构建,捆绑,编译". So, I suggest we should specify a term translation convention, like vuejs 术语翻译约定

Here is some words I found we should specify

  1. end-bundlers
  2. unbundled:
  3. built modules
  4. no-bundle
  5. pre-bundling
  6. rebasing / public path rebase
  7. first-class support

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.