Skip to content

[pull] indonesian from master #257

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

Merged
merged 6 commits into from
Sep 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/api/sfc-script-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Think of `MyComponent` as being referenced as a variable. If you have used JSX,

### Dynamic Components

Since components are referenced as variables instead of registered under string keys, we should use dynamic `:is` binding when using dynamic components inside `<script setup>`:
Since components are referenced as variables instead of registered under string keys, you should use dynamic `:is` binding when using dynamic components inside `<script setup>`:

```vue
<script setup>
Expand Down Expand Up @@ -133,7 +133,7 @@ import * as Form from './form-components'

## `defineProps` and `defineEmits`

To declare options like `props` and `emits` with full type inference support, we can use the `defineProps` and `defineEmits` APIs, which are automatically available inside `<script setup>`:
To declare `props` and `emits` in `<script setup>`, you must use the `defineProps` and `defineEmits` APIs, which provide full type inference support and are automatically available inside `<script setup>`:

```vue
<script setup>
Expand All @@ -148,7 +148,7 @@ const emit = defineEmits(['change', 'delete'])

- `defineProps` and `defineEmits` are **compiler macros** only usable inside `<script setup>`. They do not need to be imported, and are compiled away when `<script setup>` is processed.

- `defineProps` accepts the same value as the `props` option, while `defineEmits` accepts the same value as the `emits` option.
- `defineProps` accepts the same value as the [`props` option](/api/options-data.html#props), while `defineEmits` accepts the same value as the [`emits` option](/api/options-data.html#emits).

- `defineProps` and `defineEmits` provide proper type inference based on the options passed.

Expand Down Expand Up @@ -195,7 +195,7 @@ const attrs = useAttrs()

## Usage alongside normal `<script>`

`<script setup>` can be used alongside normal `<script>`. A normal `<script>` may be needed in cases where we need to:
`<script setup>` can be used alongside normal `<script>`. A normal `<script>` may be needed in cases where you need to:

- Declare options that cannot be expressed in `<script setup>`, for example `inheritAttrs` or custom options enabled via plugins.
- Declaring named exports.
Expand Down
8 changes: 4 additions & 4 deletions src/guide/migration/attribute-coercion.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Penghapusan konsep atribut yang dapat dienumerasi dan `attr="false"` dapat mengh
| `draggable` | `draggable` &rarr; `false` |
| `spellcheck` | `spellcheck` &rarr; `true` |

Supaya perilaku lama tetap dapat dijalankan, dan karena Anda akan menngubah nilai `false` menjadi `'false'`, pada Vue versi 3.x pengembang harus membuat ekspresi `v-bind` pada atribut `contenteditable` dan `spellcheck` agar menghasilkan nilai `false` atau `'false'`.
Since we no longer coerce `null` to `'false'` for “enumerated properties” in 3.x, in the case of `contenteditable` and `spellcheck`, developers will need to change those `v-bind` expressions that used to resolve to `null` to resolve to `false` or `'false'` in order to maintain the same behavior as 2.x.

Pada Vue versi 2.x, nilai yang tidak valid diubah menjadi `'true'` untuk atribut yang dapat dienumerasi. Perilaku tersebut biasanya tidak diharapkan dan tidak diinginkan pada kasus skala besar. Pada Vue versi 3.x `true` atau `'true'` harus dinyatakan secara eksplisit.

Expand All @@ -106,8 +106,8 @@ Pada Vue versi 3.x, penghapusan atribut harus dinyatakan secara eksplisit dengan
</thead>
<tbody>
<tr>
<td rowspan="3">2.x, atribut yang dapat dienumerasi<br><small>seperti <code>contenteditable</code>, <code>draggable</code> dan <code>spellcheck</code>.</small></td>
<td><code>undefined</code>, <code>false</code></td>
<td rowspan="3">2.x “Enumerated attrs”<br><small>i.e. <code>contenteditable</code>, <code>draggable</code> and <code>spellcheck</code>.</small></td>
<td><code>undefined</code></td>
<td><code>undefined</code>, <code>null</code></td>
<td><i>dihapus</i></td>
</tr>
Expand All @@ -120,7 +120,7 @@ Pada Vue versi 3.x, penghapusan atribut harus dinyatakan secara eksplisit dengan
<td><code>"true"</code></td>
</tr>
<tr>
<td><code>null</code>, <code>'false'</code></td>
<td><code>null</code>, <code>false</code>, <code>'false'</code></td>
<td><code>false</code>, <code>'false'</code></td>
<td><code>"false"</code></td>
</tr>
Expand Down
4 changes: 2 additions & 2 deletions src/guide/web-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module.exports = {
.rule('vue')
.use('vue-loader')
.tap(options => ({
...options
...options,
compilerOptions: {
// treat any tag that starts with ion- as custom elements
isCustomElement: tag => tag.startsWith('ion-')
Expand Down Expand Up @@ -200,7 +200,7 @@ It is recommended to export the individual element constructors to give your use
```js
import { defineCustomElement } from 'vue'
import Foo from './MyFoo.ce.vue'
import Bar from './MyBar.ce.bar'
import Bar from './MyBar.ce.vue'

const MyFoo = defineCustomElement(Foo)
const MyBar = defineCustomElement(Bar)
Expand Down