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

一个组件就渲染了一次 #10883

Closed
chenmoand opened this issue Dec 1, 2019 · 1 comment
Closed

一个组件就渲染了一次 #10883

chenmoand opened this issue Dec 1, 2019 · 1 comment

Comments

@chenmoand
Copy link

@chenmoand chenmoand commented Dec 1, 2019

Version

2.6.10

Reproduction link

https://codepen.io/chenmoand/pen/gObYZRw

Steps to reproduce

像这种闭合自定义标签就只能创建一次吗?还是bug?

What is expected?

姓名语文数学英语总和平均值

lucy90959828394.33

tom89969828394.33

jack90959828394.33

What is actually happening?

姓名语文数学英语总和平均值

lucy90959828394.33

@sodatea

This comment has been minimized.

Copy link
Member

@sodatea sodatea commented Dec 1, 2019

HTML 中没有自闭合标签的概念。
这种用法只能用于 .vue 文件或者 jsx 中。
你直接在 DOM 里这样用,解析会有问题。

参见
https://stackoverflow.com/q/3558119/2302258
https://vuejs.org/v2/style-guide/#Self-closing-components-strongly-recommended

@sodatea sodatea closed this Dec 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.