Git Product home page Git Product logo

Comments (2)

fritx avatar fritx commented on August 17, 2024 1

@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.

pablohpsilva avatar pablohpsilva commented on August 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.