Skip to content
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

[vue] 8.vue slot是做什么的? #399

Open
qiilee opened this issue Oct 8, 2019 · 2 comments
Open

[vue] 8.vue slot是做什么的? #399

qiilee opened this issue Oct 8, 2019 · 2 comments
Labels

Comments

@qiilee
Copy link
Member

qiilee commented Oct 8, 2019

答案:主要是让组件的可扩展性更强,简单点说就是,能够在组件内写其他内容

@qiilee qiilee added the VUE label Oct 8, 2019
@asdf-wq
Copy link

asdf-wq commented Oct 24, 2019

插槽? 插孔???

@Yuaao
Copy link

Yuaao commented Jan 8, 2020

// CompOne组件创建时候

<slot name="header"></slot>
<slot name="body"></slot>

// 组件使用的时候
<comp-one> <span slot="header"> this is header</span> // 对应CompOne件中的位置 <span slot="body"> this is body</span> //对应CompOne件中的位置 </comp-one>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants