Comments (2)
@pablohpsilva Hah, thanks for your reply!
I believe name, mixins, extends, props are very important to know what the component is (name), what is made of (mixins, extends) and what you can do with it (props).
I'm very agreed with that, and I think, "Birds of a feather flock together",
another principle is cool as well -- things should be categorized by types.
The accepted values of components
are same as extends
and mixins
, are all Components,
so I think a better practice is to place them together, it would look very clear.
For example, in one of my libraries:
https://github.com/fritx/vue-threejs/search?utf8=%E2%9C%93&q=components%3A&type=
import { PositionalAudio, AudioLoader } from 'three'
import Object3D from './Object3D'
export default {
name: 'PositionalAudio',
mixins: [Object3D],
components: { Object3D },
inject: ['global'],
props: {
refDistance: { type: Number, default: 10 },
volume: { type: Number, default: 1 },
paused: Boolean,
loop: Boolean,
url: String
},
from vuejs-component-style-guide.
Hello @fritx !
Let's talk about it. Yeap, I do believe all components attributes should be easy to read and easy to spot.
With that in mind, I believe it would be better if computed
attr could be placed right after props.
"But... Why?" You may ask. I believe name
, mixins
, extends
, props
are very important to know what the component is (name
), what is made of (mixins
, extends
) and what you can do with it (props
). Everything else, from a user (another developer) point of view is not really relevant, specially if the component works.
I love having the props all the way up, because, usually, that's what really matters to me when using components.
What do you think?
from vuejs-component-style-guide.
Related Issues (20)
- "options" should be "props" HOT 1
- Remove use-component-name-as-style-scope HOT 5
- Docute docs translation links are broken HOT 5
- About watch and methods HOT 2
- broken url HOT 2
- 错别字
- [New] When should I create a new component ? HOT 12
- Directory Structure Patterns HOT 7
- Section "Assign this to component" example does no show it HOT 6
- How about a complementing application HOT 3
- Application structure ? HOT 3
- Component naming section is confusing to me HOT 2
- /deep/ selector HOT 7
- Add standalone templates as suggestion HOT 2
- 中文翻译中的一个小错误 HOT 2
- Component's name in folder HOT 1
- 'Keep component props primitive' - typos in sample code HOT 3
- #use-script-inside-component is not found HOT 1
- 句子勘误
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vuejs-component-style-guide.