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

组件前面加一个n前缀的用意是什么? #10

Open
tingyuji opened this issue May 28, 2018 · 1 comment
Open

组件前面加一个n前缀的用意是什么? #10

tingyuji opened this issue May 28, 2018 · 1 comment

Comments

@tingyuji
Copy link

tingyuji commented May 28, 2018

在app.vue中有如下代码
import nHeader from './components/header.vue'; import nFooter from './components/footer.vue'; import nAdd from './components/event_add.vue'; import nTable from './components/event_table.vue'; import nList from './components/event_list.vue'; import nSidebar from './components/sidebar.vue'; import nDialog from './components/dialog.vue'; import nTheme from './components/theme.vue';
其中n前缀的用意是什么?

@lin-xin
Copy link
Owner

lin-xin commented May 28, 2018

组件命名为了不和原始的 HTML 标签重名,比如 header , footer 等都是 HTML 标签。命名只是为了区分。像一般都会加个前缀,比如 Element ui 组件命名一般会加个 el- 作为前缀

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

No branches or pull requests

2 participants