-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[vue] 你有写过自定义组件吗? #260
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
Labels
vue
vue
Comments
我自己写了一套公司UI/底层组件库 |
这咋回答呢?随便吹?我写了个cavascript? |
写过 |
写过,随便说点组件的引入问题、注册问题、传值问题吧 |
自定义组件的写法创建一个名为 MyComponent.vue 的单文件组件:
在父组件中使用自定义组件:
在上述示例中,MyComponent.vue 是一个自定义组件,它包含了模板、样式和逻辑。在模板中,使用了双花括号 {{}} 来绑定属性值和显示数据。通过 @click 事件监听器绑定了一个点击事件。 在父组件中,通过引入 MyComponent 并在 components 选项中注册,就可以在模板中使用该自定义组件。通过设置组件的 props 属性,可以传递数据给自定义组件,并在组件内部使用。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
[vue] 你有写过自定义组件吗?
The text was updated successfully, but these errors were encountered: