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
This method accepts the same argument as [`defineComponent`](#definecomponent), but instead returns a native [Custom Element](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements) class constructor.
-**`shadowRoot`** <supclass="vt-badge"data-text="3.5+"/>: `boolean`, defaults to `true`. Set to `false`to render the custom element without a shadow root. This means `<style>`in custom element SFCs will no longer be encapsulated.
-**`nonce`** <supclass="vt-badge"data-text="3.5+"/>: `string`, if provided, will be set as the `nonce` attribute on style tags injected to the shadow root.
Note that instead of being passed as part of the component itself, these options can also be passed via a second argument:
43
+
注意,这些选项也可以不作为组件本身的一部分传递,而是通过第二个参数传递:
45
44
46
45
```js
47
46
importElementfrom'./MyElement.ce.vue'
@@ -53,35 +52,35 @@ This method accepts the same argument as [`defineComponent`](#definecomponent),
53
52
})
54
53
```
55
54
56
-
The return value is a custom element constructor that can be registered using [`customElements.define()`](https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/define).
-Also note that `defineCustomElement()`requires [special config](/guide/extras/web-components#sfc-as-custom-element) when used with Single-File Components.
0 commit comments