You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**BREAKING:**Custom elements whitelisting is now performed during template compilation, and should be configured via compiler options instead of runtime config.
11
-
-**BREAKING:**Special`is`prop usage is restricted to the reserved `<component>`tag only.
12
-
-**NEW:**There is new `v-is`directive to support 2.x use cases where `is`was used on native elements to work around native HTML parsing restrictions.
-**NEW:**新しい `v-is`ディレクティブが追加され、ネイティブ HTML のパース制限を回避するためにネイティブ要素で `is`が使用されていた 2.x のユースケースをサポートするようになりました。
13
13
14
-
## Autonomous Custom Elements
14
+
## 自主的なカスタム要素
15
15
16
-
If we want to add a custom element defined outside of Vue (e.g. using the Web Components API), we need to 'instruct' Vue to treat it as a custom element. Let's use the following template as an example.
16
+
Vue の外部で定義されたカスタム要素を追加したい場合(例えば Web Components API の使用)、Vue にカスタム要素として扱うように「指示」する必要があります。以下のテンプレートを例にしてみましょう。
17
17
18
18
```html
19
19
<plastic-button></plastic-button>
20
20
```
21
21
22
-
### 2.x Syntax
22
+
### 2.x での構文
23
23
24
-
In Vue 2.x, whitelisting tags as custom elements was done via `Vue.config.ignoredElements`:
-If using a build step: pass the`isCustomElement`option to the Vue template compiler. If using `vue-loader`, this should be passed via `vue-loader`'s `compilerOptions`option:
The Custom Elements specification provides a way to use custom elements as [Customized Built-in Element](https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-customized-builtin-example) by adding the `is` attribute to a built-in element:
Vue's usage of the `is`special prop was simulating what the native attribute does before it was made universally available in browsers. However, in 2.x it was interpreted as rendering a Vue component with the name `plastic-button`. This blocks the native usage of Customized Built-in Element mentioned above.
-When used on the reserved `<component>`tag, it will behave exactly the same as in 2.x;
77
-
-When used on normal components, it will behave like a normal prop:
76
+
-予約済みの `<component>`タグで使用された場合、2.x と全く同じ動作をします。
77
+
-通常のコンポーネントに使用すると、通常のプロパティのように動作します。
78
78
79
79
```html
80
80
<foois="bar" />
81
81
```
82
82
83
-
- 2.x behavior: renders the `bar`component.
84
-
- 3.x behavior: renders the `foo`component and passing the `is`prop.
83
+
- 2.x の動作: `bar`コンポーネントをレンダリングします。
84
+
- 3.x の動作: `foo`コンポーネントをレンダリングし、`is`プロパティを渡します。
85
85
86
-
-When used on plain elements, it will be passed to the `createElement` call as the `is` option, and also rendered as a native attribute. This supports the usage of customized built-in elements.
>Note:this section only affects cases where Vue templates are directly written in the page's HTML.
102
-
> When using in-DOM templates, the template is subject to native HTML parsing rules. Some HTML elements, such as `<ul>`, `<ol>`, `<table>` and `<select>` have restrictions on what elements can appear inside them, and some elements such as `<li>`, `<tr>`, and `<option>` can only appear inside certain other elements.
101
+
>注: このセクションは、Vue テンプレートがページの HTML に直接記述されている場合にのみ影響します。
0 commit comments