-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Translated cookbook/editable-svg-icons.md #689
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
Conversation
type: cookbook | ||
order: 4 | ||
--- | ||
|
||
## Base Example | ||
## 基础示例 |
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.
这些段落是不是应该在 cookbook 范围内统一?前两篇是 simple example
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.
是的,最好是 Simple Example
|
||
There are many ways to create an SVG Icon System, but one method that takes advantage of Vue's capabilities is to create editable inline icons as components. Some of the advantages of this way of working is: | ||
我们有很多创建一套 SVG 图标系统的方式,但是有一种方法能够充分发挥 Vue 的能力,那就是创建可编辑的内联图标。这样做有好多好处: |
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.
把可编辑的内联图标创建为组件?
* You can use standard props and defaults to keep them to a typical size or alter them if you need to | ||
* They are inline, so no HTTP requests are necessary | ||
* They can be made accessible dynamically | ||
* 图标易于在线编辑 |
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.
「在线编辑」是不是有一种用户自己编辑的感觉,「实时修改」如何
* They are inline, so no HTTP requests are necessary | ||
* They can be made accessible dynamically | ||
* 图标易于在线编辑 | ||
* 图标是带动画的 |
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.
可以带动画?
* 图标是带动画的 | ||
* 你可以使用标准的 prop 和默认值来将图标保持在一个典型的尺寸并随时按需改变它们 | ||
* 图标是内联的,所以不需要额外的 HTTP 请求 | ||
* 可以动态的使得图标可访问 |
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.
动态地
@@ -143,27 +144,27 @@ export default { | |||
} | |||
``` | |||
|
|||
We're applying `refs` to the groups of paths we need to move, and as both sides of the scissors have to move in tandem, we'll create a function we can reuse where we'll pass in the `refs`. The use of GreenSock helps resolve animation support and transform-origin issues across browser. | |||
我们通过 `refs` 将我们需要移动的路径做了分组,因为这把剪刀的两侧需要同时移动,所以我们会创建一个传入 `refs` 的可复用的函数。并使用 GreenSock 帮助我们完成动画并解决 `transform-origin` 的浏览器兼容性问题。 |
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.
我觉得原文应该写成 ref
s,这里应该就翻译成 ref
。
|
||
<p data-height="300" data-theme-id="0" data-slug-hash="dJRpgY" data-default-tab="result" data-user="Vue" data-embed-version="2" data-pen-title="Editable SVG Icon System: Animated icon" class="codepen">See the Pen <a href="https://codepen.io/team/Vue/pen/dJRpgY/">Editable SVG Icon System: Animated icon</a> by Vue (<a href="https://codepen.io/Vue">@Vue</a>) on <a href="https://codepen.io">CodePen</a>.</p><script async src="https://production-assets.codepen.io/assets/embed/ei.js"></script> | ||
|
||
<p style="margin-top:-30px">Pretty easily accomplished! And easy to update on the fly.</p> | ||
<p style="margin-top:-30px">很容易做到吧!并且很容易在线更新。</p> |
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.
实时更新?
|
||
## Additional Notes | ||
## 额外的注意事项 |
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.
是不是就写注意事项就行了?
|
||
Designers may change their minds. Product requirements change. Keeping the logic for the entire icon system in one base component means you can quickly update all of your icons and have it propagate through the whole system. Even with the use of an icon loader, some situations require you to recreate or edit every SVG to make global changes. This method can save you that time and pain. | ||
设计师可能会改变他们的主义。产品需求也可能会变更。在一个基础组件中保持整个图标系统的逻辑,意味着你可以快速更新你所有的图标并快速丰富你的整个图标系统。甚至通过图标加载器,有些情况下需要你重新创建或编辑每个 SVG 来完成全局的改动。这个方法可以节约你的时间,减少你的痛苦。 |
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.
主义 → 主意
|
||
## When To Avoid This Pattern | ||
## 合适避免使用这个模式 |
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.
合适 → 何时
Thanks.