Skip to content

Revert default component name option #598

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

Merged
merged 2 commits into from
Jan 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions docs/en/start/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ Beware that `src` imports follow the same path resolution rules to CommonJS `req
<style src="todomvc-app-css/index.css">
```

### Component Name

If you don't specified the component name with [name](https://vuejs.org/v2/api/#name) component option, by default, it's named based on your `*.vue` filename (no `.vue` extention).

### Syntax Highlighting

Currently there is syntax highlighting support for [Sublime Text](https://github.com/vuejs/vue-syntax-highlight), [Atom](https://atom.io/packages/language-vue), [Vim](https://github.com/posva/vim-vue), [Visual Studio Code](https://marketplace.visualstudio.com/items/liuji-jim.vue), [Brackets](https://github.com/pandao/brackets-vue), and [JetBrains products](https://plugins.jetbrains.com/plugin/8057) (WebStorm, PhpStorm, etc). Contributions for other editors/IDEs are highly appreciated! If you are not using any pre-processors in Vue components, you can also get by treating `*.vue` files as HTML in your editor.
Expand Down
6 changes: 0 additions & 6 deletions lib/component-normalizer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
module.exports = function normalizeComponent (
name,
scriptExports,
compiledTemplate,
scopeId,
Expand All @@ -26,11 +25,6 @@ module.exports = function normalizeComponent (
? scriptExports.options
: scriptExports

// default name option based on filename
if (options.name == null) {
options.name = name
}

// render functions
if (compiledTemplate) {
options.render = compiledTemplate.render
Expand Down
4 changes: 0 additions & 4 deletions lib/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,17 +243,13 @@ module.exports = function (content) {

// we require the component normalizer function, and call it like so:
// normalizeComponent(
// name,
// scriptExports,
// compiledTemplate,
// scopeId,
// cssModules
// )
output += 'var Component = require("' + componentNormalizerPath + '")(\n'

// name
output += ' /* name */\n ' + JSON.stringify(path.parse(filePath).name) + ',\n'

// <script>
output += ' /* script */\n '
var script = parts.script
Expand Down
1 change: 0 additions & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ describe('vue-loader', function () {
test({
entry: './test/fixtures/basic.vue'
}, function (window, module, rawModule) {
expect(module.name).to.equal('basic')
var vnode = mockRender(module, {
msg: 'hi'
})
Expand Down