-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
用 Shadow DOM v1 和 Custom Elements v1 实现一个原生 Web Component #4826
用 Shadow DOM v1 和 Custom Elements v1 实现一个原生 Web Component #4826
Conversation
校对认领 |
@CoderMing 好的呢 🍺 |
校对认领 |
@Raoul1996 妥妥哒 🍻 |
@Raoul1996 抓紧校对了 |
@CoderMing 抓紧时间校对啦 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不好意思耽误这么久。翻译得好棒!几乎没有什么小缺陷了。个人提了两点小建议,如果有疑问的话请继续交流~
TODO1/native-web-components.md
Outdated
|
||
You will also need a couple polyfills. The web standards that we are using are new and they are [not supported by all browsers](https://caniuse.com/#search=custom%20elements%20v1). At least for the present, polyfills are necessary. For this simple component, we only require two: [custom elements](https://github.com/webcomponents/custom-elements) and [shadydom](https://github.com/webcomponents/shadydom). You can install them with Bower: | ||
你还需要一些 polyfills。我们使用的 web 标准非常新,[还没被所有浏览器支持](https://caniuse.com/#search=custom%20elements%20v1),至少到目前为止,polyfills 是必须的。对于我们这个简单的组件,只需要两个 polyfills:[custom elements](https://github.com/webcomponents/custom-elements) 和 [shadydom](https://github.com/webcomponents/shadydom),可以用 Bower 安装: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里 polyfills 去掉复数形式 变为 polyfill 好一点吧?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
还没来得及改就合掉了😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我合的时候改啦
TODO1/native-web-components.md
Outdated
@@ -80,9 +80,9 @@ suite('<mini-form>', () => { | |||
}); | |||
``` | |||
|
|||
To run the test, we will use the [web component tester](https://github.com/Polymer/web-component-tester) created by the [Polymer Project](https://www.polymer-project.org/). Install the web-component-tester with NPM and add `node_modules/web-component-tester/browser.js` to the head of `mini-form-test.html`. Both polyfills and the `mini-form.js` script should already be on the page. | |||
为了运行测试,我们要用到 [Polymer Project](https://www.polymer-project.org/) 创建的 [web component tester](https://github.com/Polymer/web-component-tester) 工具。用 NPM 安装好 web-component-tester 之后,在 `mini-form-test.html` head 里加上 `node_modules/web-component-tester/browser.js`,polyfills 和 `mini-form.js` 也应该在页面上了。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
「在 mini-form-test.html
head 里」 => 「在 mini-form-test.html
文件的 head 标签里」
这样子更易于理解
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个确实,我之后另提 PR 修改
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我合的时候改啦
@Raoul1996 抓紧校对哈 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@newraina 本文翻译的很赞
@Raoul1996 那就不用再继续校对了
@newraina 已经 merge 啦~ 快快麻溜发布到掘金然后给我发下链接,方便及时添加积分哟。 掘金翻译计划有自己的知乎专栏,你也可以投稿哈,推荐使用一个好用的插件。 |
OK |
@newraina 记得发布文章,并及时反馈给我链接 |
译文翻译完成,resolve #4796